/*

*/
var KEY_SHIFT	= 20;
var KEY_CTRL	= 17;
var KEY_SELECTALL = "A".charCodeAt(0);

var strParameters;
var selline;

function activeLine(tr) 
{	
	//if(tr!=selline)tr.style.background = "#f7f7f7";
}

function resumeLine(tr) 
{	
	//if(tr!=selline) tr.style.background =(tr.getAttribute('notalternate')=="1")?"white":"#FBF2EA";
	//if(tr!=selline) tr.style.background = "#ffffff";
}


////
function selectLine(tr) 
{		

	unselectedLine(selline);
	selectedLine(tr);
	selline=tr;
	
}

function selectedLine(tr)
{
	//tr.style.background = "e8e8e8";
	//document.all.dgList_UniqueKey.value = tr.PKvalue;
	//strParameters=tr.getAttribute('primarykey');
	//if(null!=document.getElementById('qList_UniqueKey'))document.getElementById('qList_UniqueKey').value=tr.getAttribute('primarykey');
}

function unselectedLine(tr)
{
	if(null!=tr)
	{
		//tr.style.background = (tr.getAttribute('notalternate')=="1")?"white":"#FBF2EA";
		//tr.style.background = "#ffffff";
		//tr.style.color = "#000000";
	}
}

	
function getSelectedCount()
{
	checkboxname=document.forms[0].chkDelete;
	if(checkboxname==null) return 0;
	var count=0;
	for( i=0; i< checkboxname.length; i++)
	{
		if(checkboxname[i].checked==true)
		{	count++;}
	}
	return count;
}	
function add(pageUrl)
{
	
	var sURL = appRoot+pageUrl;
	var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:650px;dialogHeight:480px';
	
	var sRtn = showModalDialog(sURL,window,featuresstring);
	if (sRtn=='dirty')
	{
		doPostBack();
	}
}

function add2(pageUrl)//ly Add Corporation
{
	
	var sURL = appRoot+pageUrl;
	var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:800px;dialogHeight:600px';
	
	var sRtn = showModalDialog(sURL,window,featuresstring);
	if (sRtn=='dirty')
	{
		doPostBack();
	}
}


function addArticle(pageUrl) //wxp //
{
	
	var sURL = appRoot+pageUrl;
	//var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:580px;dialogHeight:450px';
	
	//var sRtn = showModalDialog(sURL,window,featuresstring);
	var sRtn=window.open(sURL,'','width=730,height=550,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	//window.open(sURL);
	if (sRtn=='dirty')
	{
		doPostBack();
	}
}	

	
function ModiArticle(pageUrl, tr)//wxp
{
	if (tr==null)
	{
		alert(Grid_SelectOneLine);
		return false;
	}
	if(getSelectedCount()>1)
	{
		alert(Grid_SelectOnlyOneLine);
		return false;
	}
	var jo="?"
	if(pageUrl.indexOf("?")!=-1)
		jo="&"
	var sURL = appRoot+pageUrl+jo+tr.rowid;
	//var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:580px;dialogHeight:450px';
	//alert(sURL);
	//var sRtn = showModalDialog(sURL,window,featuresstring);
	var sRtn=window.open(sURL,'','width=730,height=550,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	if (sRtn=='dirty')
	{
		doPostBack();
	}
}

function ModiEdition(pageUrl, tr)//wxp
{
  var name="id";
  var str=window.location.search;
  var src = pageUrl+"?Editionid=";

 if (str.indexOf(name)!=-1)
 {
  var pos_start=str.indexOf(name)+name.length+1;
  var pos_end=str.indexOf("&",pos_start);
  if (pos_end==-1)
  {
  src=src+str.substring(pos_start);
  }
  else
  {
    src=src+str.substring(pos_start,pos_end)
  }
}

	if (tr==null)
	{
		alert(Grid_SelectOneLine);
		return false;
	}
	if(getSelectedCount()>1)
	{
		alert(Grid_SelectOnlyOneLine);
		return false;
	}
	var sURL = appRoot+src+"&"+tr.rowid;
	//var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:580px;dialogHeight:450px';
	//alert(sURL);
	//var sRtn = showModalDialog(sURL,window,featuresstring);
	var sRtn=window.open(sURL,'','width=730,height=550,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	if (sRtn=='dirty')
	{
		doPostBack();
	}
}

			
function addKeyword(pageUrl) ////
{
	
	var sURL = appRoot+pageUrl;
	//var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:580px;dialogHeight:450px';
	
	//var sRtn = showModalDialog(sURL,window,featuresstring);
	var sRtn=window.open(sURL,'','width=730,height=550,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	//window.open(sURL);
	if (sRtn=='dirty')
	{
		doPostBack();
	}
}

function ModiKeyword(pageUrl, tr)  
			{
	if(tr==null)
	{
		alert(Grid_SelectOneLine);
		return false;
	}
	if(getSelectedCount()>1)
	{
		alert(Grid_SelectOnlyOneLine);
		return false;
	}
	var jo="?"
	if(pageUrl.indexOf("?")!=-1)
		jo="&"
	var sURL = appRoot+pageUrl+jo+tr.rowid;
	var sRtn=window.open(sURL,'','width=730,height=550,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	if (sRtn=='dirty')
	{
		doPostBack();
	}
}


function openSelectColumn(pageUrl) //wxp //
{
	
	var sURL = appRoot+pageUrl;
	var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:590px;dialogHeight:450px';
	
	var sRtn = showModalDialog(sURL,window,featuresstring);
	if (sRtn!=''&&sRtn!=null)
	{
	//if(sRtn.indexOf(",")>-1)
	//{
	//document.all.opencolumn.value=sRtn.substring(0,sRtn.indexOf(","));
	//}
	//else
	//{
	//document.all.opencolumn.value=sRtn;
	//}
	document.all.opencolumn.value=sRtn.substring(0,sRtn.indexOf(","));
	document.all.title.value=sRtn.substring((sRtn.indexOf(",")+1));
	document.all.titleView.value=sRtn.substring((sRtn.indexOf(",")+1));
		
	}
}

function openAddUrl(pageUrl)
{
	
	var sURL = appRoot+pageUrl;
	//var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:580px;dialogHeight:450px';
	
	//var sRtn = showModalDialog(sURL,window,featuresstring);
	var sRtn=window.open(sURL,'','width=800,height=600,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	//window.open(sURL);
	if (sRtn=='dirty')
	{
		doPostBack();
	}
}		
	
function openWindow(pageUrl,width,height,target,msg)
{
	if(msg!=null&&msg!="")
	{
		if(!confirm(msg)) return;
	}
	var swd = window.screen.availWidth;
	var sht = window.screen.availHeight;
	if(width==null) width=790;
	if(height==null) height=580;
	var left = (swd-width)/2;
	var top = (sht-height)/2;
		
	var sURL = appRoot+pageUrl;
	var sTarget="_openWindow";
	if(target!=null)
	{
		sTarget=target;
	}
		
	var sRtn=window.open(sURL,sTarget,'width='+width+',height='+height+',left='+left+',top='+top+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	sRtn.focus();
	return sRtn;
}

function openFileWindow(pageUrl,oBtn)
{
	var btns=document.getElementsByName(oBtn.name);
	var index=0;
	for(var i=0;i<btns.length;i++)
	{
		if(btns[i]==oBtn)
		{
		  index=i;
		}
	}
	
	openWindow(pageUrl+'&idx='+index,420,160)
}

function openInterWindow(pageUrl,width,height)
{
	
 	var swd = window.screen.availWidth;
	var sht = window.screen.availHeight;
	
	var left = (swd-width)/2;
	var top = (sht-height)/2;

 var name="id";
  var str=window.location.search;
  var src = pageUrl+"?interid=";

 if (str.indexOf(name)!=-1)
 {
  var pos_start=str.indexOf(name)+name.length+1;
  var pos_end=str.indexOf("&",pos_start);
  if (pos_end==-1)
  {
  src=src+str.substring(pos_start);
  }
  else
  {
    src=src+str.substring(pos_start,pos_end)
  }
}
	window.open(src,"",'width='+width+',height='+height+',left='+left+',top='+top+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
	window.close();		
}

function multiLanguage(id,name)
{
	if(MultiLang == "0") return;
	var idField=document.getElementsByName(id)[0];
	var nameField=document.getElementsByName(name)[0];
	
	var sUrl = "include/MultiInput.aspx?id="+id+"&name="+name;
	var width=400,height=200;
	var varg='resizable:yes;help:no;status:no;center:Yes;dialogWidth:'+width+'px;dialogHeight:'+height+'px'
	var str=window.showModalDialog(appRoot+sUrl,idField,varg);
	if(str!=null)
	{
		
		var arrStr=str.split('|');
		nameField.value=arrStr[0];
		idField.value=arrStr[1];
		nextFocus(nameField);
	}
}

function multiLangSetVal(id,name)
{
	if(MultiLang == "1") return;
	var nameField=document.getElementsByName(name)[0].value;
	document.getElementsByName(id)[0].value=nameField;
//	alert(document.getElementsByName(id)[0].value);
}

	function openEdit(pageUrl, tr)
	{
		if (tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		if(getSelectedCount()>1)
		{
			alert(Grid_SelectOnlyOneLine);
			return false;
		}
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+tr.rowid;
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:680px;dialogHeight:480px';
		//alert(sURL);
		var sRtn = showModalDialog(sURL,window,featuresstring);
		if (sRtn=='dirty')
		{
			doPostBack();
		}
	}
	
	function openEdit2(pageUrl, tr)
	{
		if (tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		if(getSelectedCount()>1)
		{
			alert(Grid_SelectOnlyOneLine);
			return false;
		}
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+tr.rowid;
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:400px;dialogHeight:250px';
		//alert(sURL);
		var sRtn = showModalDialog(sURL,window,featuresstring);
		if (sRtn=='dirty')
		{
			doPostBack();
		}
	}

	function openEdit3(pageUrl, tr)
	{
		if (tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var sURL = appRoot+pageUrl+"?"+tr.rowid;
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:350px;dialogHeight:200px';
		//alert(sURL);
		var sRtn = showModalDialog(sURL,window,featuresstring);
		if (sRtn=='dirty')
		{
			doPostBack();
		}
	}

	function openEditUrl(pageUrl, tr)//wxp
	{
		if (tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		if(getSelectedCount()>1)
		{
			alert(Grid_SelectOnlyOneLine);
			return false;
		}
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+tr.rowid;
		
		//var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:580px;dialogHeight:450px';
		//alert(sURL);
		//var sRtn = showModalDialog(sURL,window,featuresstring);
		var sRtn=window.open(sURL,'','width=800,height=600,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
		if (sRtn=='dirty')
		{
			doPostBack();
		}
	}


	function view(pageUrl, tr)
	{
		if (tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		if(getSelectedCount()>1)
		{
			alert(Grid_SelectOnlyOneLine);
			return false;
		}
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+tr.rowid;
		
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:650px;dialogHeight:480px';
		showModalDialog(sURL,window,featuresstring);
	}

	function viewo(pageUrl, tr)
	{
		if (tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		if(getSelectedCount()>1)
		{
			alert(Grid_SelectOnlyOneLine);
			return false;
		}
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+tr.rowid;
		
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:650px;dialogHeight:570px';
		showModalDialog(sURL,window,featuresstring);
			}

	function setDefaultPage(pageUrl,tr)
	{
		if (tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		if(getSelectedCount()>1)
		{
			alert(Grid_SelectOnlyOneLine);
			return false;
		}
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+"delClick=del&"+tr.rowid+"&xmlName="+document.all.xmlName.value;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		
			
		if (confirm(Message_Index))
		{
			var sRtn = showModalDialog(sURL,window,featuresstring);
			if (sRtn=='dirty')
			{
				doPostBack();
			}
		}
		
	}
	
	function hiddenDialog(pageUrl)
	{
		
		var sURL = appRoot+pageUrl;
		
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		var sRtn = showModalDialog(sURL,window,featuresstring);
		if (sRtn=='dirty')
		{
				doPostBack();
		}
	}
	
	//update indexer
	
	function updateIndex(pageUrl,tr, thisform)
	{
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		
		var sURL = appRoot+pageUrl+jo+"updateClick=update&xmlName="+document.all.xmlName.value+"&updateIndexID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		if (confirm(Grid_ConfirmUpdateIndex))
		
		{
			var sRtn = showModalDialog(sURL,window,featuresstring);
			if (sRtn=='dirty')
			{
				doPostBack();
			}
		}
	}
	

	function insertIndex(pageUrl,tr, thisform)
	{
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		
		var sURL = appRoot+pageUrl+jo+"insertClick=insert&xmlName="+document.all.xmlName.value+"&insertIndexID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		if (confirm(Grid_ConfirmInsertIndex))
		
		{
			var sRtn = showModalDialog(sURL,window,featuresstring);
			if (sRtn=='dirty')
			{
				doPostBack();
			}
		}
	}


	function deleteRow(pageUrl,tr, thisform)
	{
	  var name="fid";
	  var str=window.location.search;
	  var src = pageUrl;
	  if (str.indexOf(name)==-1)
		name = "s2";
	   if (str.indexOf(name)!=-1)
	    {
	      var pos_start=str.indexOf(name)+name.length+1;
	      var pos_end=str.indexOf("&",pos_start);
	      if (pos_end==-1)
	        {
	          src=src+"?fid="+str.substring(pos_start);
	        }
	      else
	       {
	        src=src+"?fid="+str.substring(pos_start,pos_end)
	       }
	   }
	  //alert(src);
	if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var jo="?"
		if(src.indexOf("?")!=-1)
			jo="&"
		
		var ids = CheckBoxDelId(thisform);
		//if(tr !=null ) ids = ids + jo+tr.rowid;
		
		var sURL = appRoot+src+jo+"delClick=del&xmlName="+document.all.xmlName.value+"&delID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		if (confirm(Grid_ConfirmDelete))
		
		{
			var sRtn = showModalDialog(sURL,window,featuresstring);
			if (sRtn=='dirty')
			{
				doPostBack();
			}
		}
	}
	
	function OperateMultLine(pageUrl,tr, thisform)
	{
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		
		var sURL = appRoot+pageUrl+jo+"delClick=del&xmlName="+document.all.xmlName.value+"&delID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		var sRtn = showModalDialog(sURL,window,featuresstring);
		if (sRtn=='dirty')
		{
			doPostBack();
		}
	}
	

	function saveRow(pageUrl,tr, thisform)
	{
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		
		var sURL = appRoot+pageUrl+jo+"saveClick=save&xmlName="+document.all.xmlName.value+"&saveID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		if (confirm(Grid_ConfirmSave))
		
		{
			var sRtn = showModalDialog(sURL,window,featuresstring);
			if (sRtn=='dirty')
			{
				doPostBack();
			}
		}
	}
	
	function saveInterRow(pageUrl,tr, thisform)
	{
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		  var name="interid";
		  var str=window.location.search;
		  var src = pageUrl+"?interid=";

		if (str.indexOf(name)!=-1)
		 {
		 var pos_start=str.indexOf(name)+name.length+1;
		 var pos_end=str.indexOf("&",pos_start);
		  if (pos_end==-1)
		  {
		  src=src+str.substring(pos_start);
		  }
		  else
		  {
		    src=src+str.substring(pos_start,pos_end)
		  }
		 }


		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		
		var sURL = appRoot+src+"&saveClick=save&xmlName="+document.all.xmlName.value+"&saveID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		if (confirm(Grid_ConfirmSave))
		
		{
			  window.open(sURL,'',featuresstring);
			  window.close();
		}
	}
	
function Showkeywordselect(pageUrl,ctrlobj,increate)
{    
showx = event.screenX - event.offsetX - 4 - 210 ; // + deltaX;
showy = event.screenY - event.offsetY - 150; // + deltaY;
newWINwidth = 210 + 4 + 18;
retval = window.showModalDialog(pageUrl, "", "dialogWidth:550px; dialogHeight:450px;status:no; directories:yes;scrollbars:no;Resizable=no;center:yes ; ");
if( retval != null )
{		
if(increate=="add")
{
if(ctrlobj.value.length>0)
ctrlobj.value =ctrlobj.value+' '+retval;
else
ctrlobj.value =retval;
}
else
{
ctrlobj.value =retval;
}
}
}	

function ShowMagazineselect(pageUrl,ctrlobj_a,ctrlobj_b,increate)
{    
showx = event.screenX - event.offsetX - 4 - 210 ; // + deltaX;
showy = event.screenY - event.offsetY - 150; // + deltaY;
newWINwidth = 210 + 4 + 18;
retval = window.showModalDialog(pageUrl, "", "dialogWidth:550px; dialogHeight:450px;status:no; directories:yes;scrollbars:no;Resizable=no;center:yes ; ");
if( retval != null )
{		
if(increate=="add"&&retval.length>32)
{
ctrlobj_a.value =retval.substring(0,retval.length-32);
ctrlobj_b.value =retval.substring(retval.length-32,retval.length);

}
else
{
ctrlobj_a.value =retval.substring(0,retval.length-32);
ctrlobj_b.value =retval.substring(retval.length-32,retval.length);

}
}
}	

function ClosePage(selectvalue)
{		
var value=selectvalue;
window.returnValue =value;
window.close();				
}

	
function searchIndex(pageUrl,searchword)
	{
		
  var name="id";
  var str=window.location.search;
  var src = pageUrl+"?interid=";

 if (str.indexOf(name)!=-1)
 {
  var pos_start=str.indexOf(name)+name.length+1;
  var pos_end=str.indexOf("&",pos_start);
  if (pos_end==-1)
  {
  src=src+str.substring(pos_start);
  }
  else
  {
    src=src+str.substring(pos_start,pos_end)
  }
}

var jo="?"
		if(src.indexOf("?")!=-1)
			jo="&"
		
		var sURL = appRoot+src+jo+"searchClick=search&xmlName="+document.all.xmlName.value+"&searchtext="+escape(searchword);
		//alert(sURL);
		location.replace(sURL);
	}
	
function selectkeywordrow(pageUrl,tr, thisform)
	{
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		
		var sURL = appRoot+pageUrl+jo+"saveClick=save&xmlName="+document.all.xmlName.value+"&saveID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		if (confirm(Grid_ConfirmSave))
		
		{
			//var sRtn = window.open(sURL,'',featuresstring);
			var sRtn="";
			if (sRtn=='dirty')
			{
				doPostBack();
			}
		}
		window.close();
	}
	

	//delete indexer
	function deleteIndex(pageUrl,tr, thisform)
	{
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		
		var sURL = appRoot+pageUrl+jo+"delClick=delIndex&xmlName="+document.all.xmlName.value+"&delIndexID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		if (confirm(Grid_ConfirmDeleteIndex))
		
		{
			var sRtn = showModalDialog(sURL,window,featuresstring);
			if (sRtn=='dirty')
			{
				doPostBack();
			}
		}
	}
	
	
	
		function OperateMultiRows(pageUrl,tr, thisform)
	{
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+"delClick=del&xmlName="+document.all.xmlName.value+"&delID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		if (confirm(Message_operate))
		{
			var sRtn = showModalDialog(sURL,window,featuresstring);
			if (sRtn=='dirty')
			{
				doPostBack();
			}
		}
	}
	
	function openMultiRows(pageUrl,tr, thisform)
	{
		
		var name="cid";
		var str=window.location.search;
		//alert(str);
		var sharecid="sharecid=";
		 if (str.indexOf(name)!=-1)
		  {
		    var pos_start=str.indexOf(name)+name.length+1;
		    var pos_end=str.indexOf("&",pos_start);
		   if (pos_end==-1)
		    {
		      sharecid=sharecid+str.substring(pos_start);
		    }
		    else
		    {
		      sharecid=sharecid+str.substring(pos_start,pos_end)
		    }
		    //alert(sharecid);
		  }
		  
		  
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+"delClick=del&xmlName="+document.all.xmlName.value+"&delID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:550px;dialogHeight:350px';
		
			var sRtn = showModalDialog(sURL+"&"+sharecid,"",featuresstring);
			if (sRtn=='dirty')
			{
				doPostBack();
			}
	}
	
	
	function auditRow(pageUrl,tr, thisform)
	{
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		var jo="?";
		if(pageUrl.indexOf("?")!=-1)
			jo="&";
		
		var sURL = appRoot+pageUrl+jo+"auditClick=del&xmlName="+document.all.xmlName.value+"&delID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		if (confirm(Message_add))
		{
			var sRtn = showModalDialog(sURL,window,featuresstring);
			if (sRtn=='dirty')
			{
				doPostBack();
			}
		}
	}
	
	function ReAuditRow(pageUrl,tr, thisform)
	{
		if (!CheckOne(thisform)&&tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var ids = CheckBoxDelId(thisform);
		if(tr !=null ) ids = ids + "&"+tr.rowid;
		
		var jo="?";
		if(pageUrl.indexOf("?")!=-1)
			jo="&";
		
		var sURL = appRoot+pageUrl+jo+"ReAuditClick=del&xmlName="+document.all.xmlName.value+"&delID="+ids;
		//alert(sURL);
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		if (confirm(Message_setting))
		{
			var sRtn = showModalDialog(sURL,window,featuresstring);
			if (sRtn=='dirty')
			{
				doPostBack();
			}
		}
	}
	
	
	function SendMsg(thisform,MsgSource,MsgSourceID,MoreInfoUrl,MoreInfoExplain,employeeFieldname,selectRow,msgFieldName,IfNeedSelectRow,InfoDefaultAccept)
	{
		if(IfNeedSelectRow!=null && IfNeedSelectRow == "yes")
		{
			if (selectRow==null)
			{
			alert(Grid_SelectOneLine);
			return false;
			}
		}
	
		var sURL = "";

		if((thisform!=null)&&(thisform!=""))
		{
			var AllIds =  CheckBoxAllId(thisform);
			var SelectIds = CheckBoxDelId(thisform);
			sURL = appRoot+"Controls/OA/QM/SendMsg.aspx"+"?selectClick=select&xmlName="+document.all.xmlName.value+"&AllIds="+AllIds+"&selectID="+SelectIds;
			//message source//
			if((MsgSource!=null)&&(MsgSource!="")&&(MsgSourceID!=null)&&(MsgSourceID!=""))
			{
				sURL = sURL+"&MsgSource="+MsgSource+"&MsgSourceID="+MsgSourceID;					  
			}
			//detail link//
			if((MoreInfoUrl!=null) && (MoreInfoUrl != "")&&(MoreInfoExplain!=null)&&(MoreInfoExplain!=""))	
			{
				if(MoreInfoUrl.indexOf("id={id}") > -1)
				{
					if (InfoDefaultAccept != null && InfoDefaultAccept != "")
					{
						sURL = sURL + "&MoreInfoUrl="+ MoreInfoUrl+"&MoreInfoExplain="+MoreInfoExplain +"&InfoDefaultAccept="+InfoDefaultAccept; 
					}
					else
					{
						if(selectRow!=null || selectRow!="")
						{						
							while(MoreInfoUrl.indexOf("id={id}") > -1)
							{
							MoreInfoUrl =MoreInfoUrl.replace("id={id}",selectRow.rowid);
							}
							sURL = sURL + "&MoreInfoUrl="+ MoreInfoUrl+"&MoreInfoExplain="+MoreInfoExplain ; 
						}
					}
				
				}
				else
				{
					sURL = sURL + "&MoreInfoUrl="+ MoreInfoUrl+"&MoreInfoExplain="+MoreInfoExplain ; 
				}
			}
			//接收人字段名//
			if((employeeFieldname!=null)&&(employeeFieldname != ""))
			{
				sURL =sURL+"&getFieldName="+employeeFieldname;
			}
			//把选定指定字段内容转发//
			if ((selectRow!=null)&&(msgFieldName!=null)&&(msgFieldName!=""))
			{              
				sURL = sURL + "&msgID="+selectRow.rowid+"&msgFieldName="+msgFieldName;
			}

			//alert(sURL);											       
		var featuresstring='width=580,height=450,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
		var sRtn = window.open(sURL,"SendMsg",featuresstring);
		
		}
		
	}
	
	function Sendmail(thisform,MoreInfoUrl,MoreInfoExplain,employeeFieldname)
	{
	
		var sURL = "";

		if((thisform!=null)&&(thisform!=""))
		{
			var AllIds =  CheckBoxAllId(thisform);
			var SelectIds = CheckBoxDelId(thisform);
			sURL = appRoot+"Controls/OA/QM/SendMailPage.aspx"+"?selectClick=select&xmlName="+document.all.xmlName.value+"&AllIds="+AllIds+"&selectID="+SelectIds;
			//说细信息链接//
			if((MoreInfoUrl!=null) && (MoreInfoUrl != "")&&(MoreInfoExplain!=null)&&(MoreInfoExplain!=""))	
			{
				if(MoreInfoUrl.indexOf("id={id}") > -1)
				{
					if (InfoDefaultAccept != null && InfoDefaultAccept != "")
					{
						sURL = sURL + "&MoreInfoUrl="+ MoreInfoUrl+"&MoreInfoExplain="+MoreInfoExplain +"&InfoDefaultAccept="+InfoDefaultAccept; 
					}
					else
					{
						if(selectRow!=null || selectRow!="")
						{						
							while(MoreInfoUrl.indexOf("id={id}") > -1)
							{
							MoreInfoUrl =MoreInfoUrl.replace("id={id}",selectRow.rowid);
							}
							sURL = sURL + "&MoreInfoUrl="+ MoreInfoUrl+"&MoreInfoExplain="+MoreInfoExplain ; 
						}
					}
				
				}
				else
				{
					sURL = sURL + "&MoreInfoUrl="+ MoreInfoUrl+"&MoreInfoExplain="+MoreInfoExplain ; 
				}
			}
			//接收人字段名//
			if((employeeFieldname!=null)&&(employeeFieldname != ""))
			{
				sURL =sURL+"&getFieldName="+employeeFieldname;
			}

			//alert(sURL);											       
		var featuresstring='width=790,height=550,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
		var sRtn = window.open(sURL,"SendMail",featuresstring);
		
		}
		
	}
	
	
	function MsgFeedbackView(MsgSource,MsgSourceID)
	{

		if((MsgSource!=null) && (MsgSource != "" )&& (MsgSourceID!=null) && (MsgSourceID != ""))
			{
			var  sURL  = "";
			sURL = appRoot + "Controls/OA/QM/QMFeedbackView.aspx?MsgSource="+MsgSource+"&MsgSourceID="+MsgSourceID;
			var featuresstring='width=580,height=450,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes';
			var sRtn = window.open(sURL,"MsgFeedback",featuresstring);
			    
			}
		
	}
	
	function gotoUrl(pageUrl, tr)
	{
		var jo="?";
		var sURL;
		if (tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		if(pageUrl == "")
		{
			pageUrl = window.location.href;
			var len = pageUrl.length;
			if(pageUrl.charAt(len-1)=='#')
				pageUrl = pageUrl.substring(0, len-1);
			if(pageUrl.indexOf("?")!=-1)
			jo="&"
			sURL = pageUrl+jo+tr.rowid;
		}
		else
		{

			if(pageUrl.indexOf("?")!=-1)
			jo="&"
			sURL = appRoot+pageUrl+jo+tr.rowid;
		}
		
		
		window.location=sURL;
	}
	
	function gotoUrlSelf(pageUrl, tr) //用于显示文章调度的，它不需要tr.rowid//
	{
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl;
		
		
		window.location=sURL;
	}

	function openUrl(pageUrl, tr)
	{
		if (tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+tr.rowid;
		
		window.open(sURL);
	}


	function gotoUrlNoId(pageUrl)
	{
		var sURL = appRoot+pageUrl;
		window.location=sURL;
	}
	
	function openUrlNoIdTR(pageUrl,tr)
	{
		if (tr==null)
		{
			alert(Grid_SelectOneLine);
			return false;
		}
		
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+tr.rowid;
		window.location=sURL;
	}
	
	function openUrlNoId(pageUrl)
	{
		
		var sURL = appRoot+pageUrl;
		window.open(sURL);
	}
	
	
function openDialog(url)
{
	var varg='resizable:yes;help:no;status:no;center:Yes;dialogWidth:380px;dialogHeight:380px'
	var str=window.showModalDialog(url,'',varg);
	if (str=='dirty')
			{
				doPostBack();
				//window.location =window.location.href;
			}
	
	return true;
}
		
function openWebDialog(url,width,height,msg)
{
	var varg='resizable:yes;help:no;status:no;center:Yes;dialogWidth:'+width+'px;dialogHeight:'+height+'px'
	if(msg!=null&&msg!="")
	{
		if(!confirm(msg)) return;
	}
	var str=window.showModalDialog(appRoot+url,window,varg);
	if (str=='dirty')
			{
				doPostBack();
				//window.location =window.location.href;
			}
	
	return str;
}
function openAbsWindow(url)
{
	var openobj = window;
	if(typeof(window.dialogArguments)=="object")
	{
		
		//if(window.dialogArguments!=null)
			//openobj=window.dialogArguments;
	}
	openobj.open(url);
	//openobj.focus();
}
		function submitToUrl(pageUrl)
		{
			var act=document.forms[0].action;
			document.forms[0].action=pageUrl;
			document.forms[0].target="_blank";
			document.forms[0].submit();
			document.forms[0].action=act;
			document.forms[0].target="_self";
			
		}
		
		
			function doPostBack()
			 {
				//window.location=window.location.href;
				document.forms[0].submit();
			}
			
			
function openChooseForm(url,field,oBtn)
{
	var returnval=openWebDialog(url,640,500);
	var btns=document.getElementsByName("btn_"+field);
	var index=0;
	for(var i=0;i<btns.length;i++)
	{
	  if(btns[i]==oBtn)
	  {
	    index=i;break;
	  }
	}
	
	var idField=document.getElementsByName(field)[index];
	var nameField=document.getElementsByName(field+"_name")[index];
	
	if(returnval!=null&&returnval!="")
	{
		
		var vals=returnval.split('|');
		var idval=vals[0];
		var nameval=vals[1];
		_WindowReturnValue=vals[2];
		
		if(nameval=="")
		{	nameval=idval;}
		idField.value=idval;
		nameField.value=nameval;
			
	}
}

function clearChooseForm(field,oBtn)
{
	var btns=document.getElementsByName("cls_"+field);
	var index=0;
	for(var i=0;i<btns.length;i++)
	{
	  if(btns[i]==oBtn)
	  {
	    index=i;break;
	  }
	}
	
	var idField=document.getElementsByName(field)[index];
	var nameField=document.getElementsByName(field+"_name")[index];
	idField.value='';
	nameField.value='';
	

}


			
function CheckOne(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name == 'chkDelete')
    {
		if(e.checked == true) return true;
    }
    }
    return false;
}


function CheckBoxDelId(form)
{
	var strvalue="";
	for (var i=0;i<form.elements.length;i++)
    {
		var e = form.elements[i];
		if (e.name == 'chkDelete')
		{
			if(e.checked == true) 
			{
				if(strvalue=="") {strvalue=e.value;}
				else { strvalue+=","+e.value;}
			}
		}
    }
    return strvalue;
}


function CheckBoxAllId(form)
{
	var strvalue="";
	for (var i=0;i<form.elements.length;i++)
    {
		var e = form.elements[i];
		if (e.name == 'chkDelete')
		{
			if(strvalue=="") {strvalue=e.value;}
			else { strvalue+=","+e.value;}
			
		}
    }
    return strvalue;
}

function SubTable_AddItem(tableId)
{
	var strNum=prompt(Message_riquire,10);
	var num=1;
	try{ num=parseInt(strNum);}catch(e){ num=1;};
	for(n=0;n<num;n++)
	{
      SubTable_AddOneItem(tableId)
  	}
}

function SubTable_AddOneItem(tableId)
{
	var table=document.all(tableId+'_List');
	var fieldArray=eval(tableId+'_array');
	var colLength = fieldArray.length;
	var currRow =table.insertRow();
	for(var i = 0; i< colLength; i++)
	{
        currCell=currRow.insertCell();
        currCell.bgColor="#FFFFFF";
        
		var fieldInput=fieldArray[i];
		if(i==0) currCell.width="10";
		if(i==colLength-1) currCell.width="90%";
		currCell.innerHTML = fieldInput;
        
    }	
    SubTable_CopyItem(tableId);
}


function SubTable_CheckAll(tableId)
{
	ca=document.all(tableId+"_CheckAll");
	d=document.all(tableId+"_RowNo");
	if(ca==null || d==null) return;
	 if(d.length != null)
	 {
		for(var i=d.length-1; i>=0; i--)
        {
           if(ca.checked) d(i).checked=true;
           else d(i).checked=false;
        }
	}
	else
	{
		if(ca.checked) d.checked=true;
		else d.checked=false;
	}	
}

function SubTable_DelItem(tableId)
{
	var table=document.all(tableId+'_List');
    d=document.all(tableId+"_RowNo");
    if(d == null) return;
    if(d.length != null)
    {
        for(var i=d.length-1; i>=0; i--)
        {
            if(d(i).checked)
            {
				table.deleteRow(i+1)
				
           }
        }
    }
    else
        if(d.checked) table.deleteRow(1);
}

function SubTable_CopyItem(tableId)
{
	var fieldArray=eval(tableId+'_fields');
	var colLength = fieldArray.length;
	for(var i = 0; i< colLength; i++)
	{
		var fieldName=fieldArray[i];
		var fieldNameInput=fieldName+"Name"
		fObj=document.all(fieldName);
		fnObj=document.all(fieldNameInput);
		
        if(fObj!=null && fObj.length!=null && fObj.length>=2)
        {
			len=fObj.length;
			//alert(fieldName+":"+fObj(len-2).value)
			fObj(len-1).value=fObj(len-2).value;
        
        }
        if(fnObj!=null && fnObj.length!=null && fnObj.length>=2)
        {
			len=fnObj.length;
			//alert(fieldName+":"+fObj(len-2).value)
			fnObj(len-1).value=fnObj(len-2).value;
        
        }
    }	
}

function selectChange(control, secondName,all)
{
  if(control.value==''||control.value=='-1') return;		

  var firstCtrls=document.getElementsByName(control.name);
  var sName=secondName.split('|');
  for(var n=0;n<sName.length;n++)
  {
	var secondCtrls=document.getElementsByName(sName[n]);
	var secondControl=secondCtrls;
	if(firstCtrls.length>0)
	{
		for( i=0; i<firstCtrls.length; i++)
		{
		 if(firstCtrls[i]==control){secondControl=secondCtrls[i];}
		}
	}
	
    if(secondControl.tagName.toLowerCase()!="select") return;
    
	var ItemId=eval(sName[n]+control.value+"_id");
	var ItemName=eval(sName[n]+control.value+"_name");
	var myEle ;
	var x ;
	// Empty the second drop down box of any choices
	for (var q=secondControl.options.length;q>=0;q--) secondControl.options[q]=null;
	 
	// ADD Default Choice - in case there are no values
	myEle = document.createElement("option") ;
	myEle.value = '' ;
	if(all==0) myEle.text = Message_please ;
	else  myEle.text = Message_wo ;
	secondControl.add(myEle) ;
	for ( x = 0 ; x < ItemId.length  ; x++ )
    {
          myEle = document.createElement("option") ;
          myEle.value = ItemId[x] ;
          myEle.text = ItemName[x] ;
          secondControl.add(myEle) ;
    }
  }
}

function PrintExcel(TableName)
{
	if(window.confirm(Message_wni))
	{

		var oXL = new ActiveXObject("Excel.Application");
		oXL.Visible = true;

		var oWB = oXL.Workbooks.Add();
		var oSheet = oWB.ActiveSheet;

		omxh = document.getElementById(TableName)
   

  
   for(i=1;i<omxh.rows[0].cells.length;i++)
   {
      oSheet.Cells(1, i).Value = omxh.rows[0].cells[i].innerText;
    }


    oSheet.Range("A1", "AA1").Font.Bold = true;
     

  for(i=1;i<omxh.rows.length;i++)
  {

	for(j=1;j<omxh.rows[i].cells.length;j++)
	{
		oSheet.Cells(i+2, j).Value = omxh.rows[i].cells[j].innerText;
	}
	oSheet.Cells(i+2, 2).NumberFormat = "@";
  }
      
}
}

function selectListLabel()
{
	var obj = document.all('selectIdentifyLabel');
	if(obj)
		return obj.value;
	return "";
}

//--------------------------------------shawei for 999 site
function addProduct(pageUrl) //增加产品//
{
	
	var sURL = appRoot+pageUrl;
	//var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:580px;dialogHeight:450px';
	
	//var sRtn = showModalDialog(sURL,window,featuresstring);
	var sRtn=window.open(sURL,'','width=1000,height=850,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	//window.open(sURL);
	if (sRtn=='dirty')
	{
		doPostBack();
	}
}
function EditProduct(pageUrl, tr)  //修改产品/
			{
	if(tr==null)
	{
		alert(Grid_SelectOneLine);
		return false;
	}
	if(getSelectedCount()>1)
	{
		alert(Grid_SelectOnlyOneLine);
		return false;
	}
	var jo="?"
	if(pageUrl.indexOf("?")!=-1)
		jo="&"
	var sURL = appRoot+pageUrl+jo+tr.rowid;
	var sRtn=window.open(sURL,'','width=1000,height=850,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	if (sRtn=='dirty')
	{
		doPostBack();
	}
}

function OpAccount(pageUrl,tr,OpType) //开放或关闭帐号//
{
	if(tr==null)
	{
		alert(Grid_SelectOneLine);
		return false;
	}
	if(getSelectedCount()>1)
	{
		alert(Grid_SelectOnlyOneLine);
		return false;
	}
	if(confirm("您确定当前操作吗？"))
	{
		var jo="?"
		if(pageUrl.indexOf("?")!=-1)
			jo="&"
		var sURL = appRoot+pageUrl+jo+tr.rowid + "&Opt=" + OpType;
		var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:0px;dialogHeight:0px';
		var sRtn = showModalDialog(sURL,window,featuresstring);
		if (sRtn=='dirty')
		{
			doPostBack();
		}
	}
	else
	{
		return;
	}
}

function openPageUrl(pageCtrl)
{
	
	var sURL = appRoot+"Model/PageUrl.aspx";
	var featuresstring='resizable:yes;help:no;status:no;center:Yes;dialogWidth:590px;dialogHeight:450px';
	
	var sRtn = showModalDialog(sURL,window,featuresstring);
	if (sRtn!=''&&sRtn!=null)
	{
		pageCtrl.value=sRtn.substring(0,sRtn.indexOf(","));
	}
}

//multiAddform
function Multi_AddItem(tableId)
{
	var strNum=prompt(Message_riquire,10);
	var num=1;
	try{ num=parseInt(strNum);}catch(e){ num=1;};
	for(n=0;n<num;n++)
	{
      Multi_AddOneItem(tableId)
  	}
}

function Multi_AddOneItem(tableId)
{
	var table=document.all(tableId+'_List');
	var rowItem=document.getElementById(tableId+'_RowItem');
	var currRow =table.insertRow();

	rowContent=unescape(decodeURIComponent(rowItem.value));
	//alert(rowContent);
	 currCell=currRow.insertCell();
	 currCell.width="10";
     currCell.bgColor="#FFFFFF";
     currCell.innerHTML = "<input type='checkbox' name='"+tableId+"_RowNo'>";
     
     currCell=currRow.insertCell();
     currCell.bgColor="#FFFFFF";
     currCell.innerHTML = rowContent;
}



function Multi_CheckAll(tableId)
{
	ca=document.all(tableId+"_CheckAll");
	d=document.all(tableId+"_RowNo");
	if(ca==null || d==null) return;
	 if(d.length != null){
		for(var i=d.length-1; i>=0; i--)
        {
           if(ca.checked) d(i).checked=true;
           else d(i).checked=false;
        }
	}
	else
	{
		if(ca.checked) d.checked=true;
		else d.checked=false;
	}	
}

function Multi_DelItem(tableId)
{
	var oTable=document.all(tableId+'_List');
	if(oTable!=null && oTable.rows.length>0)
	{
	for(var n=oTable.rows.length-1;n>=0;n--)
	{
		var oRow=oTable.rows[n];
		dd=oRow.cells[0].all(tableId+"_RowNo");
		if(dd.checked)
		 {oTable.deleteRow(n);}
	
	}
	}
		
}
