 var _expandShrinkImgName = new Array(4);
	 _expandShrinkImgName[0] = "imgContentManage";
	 _expandShrinkImgName[1] = "imgSec";
	 _expandShrinkImgName[2] = "imgUserProperty";
	 _expandShrinkImgName[3] = "imgSysInfo";
	 var _expandShrinkTblName = new Array(4);
	 _expandShrinkTblName[0] = "tblContentManage";
	 _expandShrinkTblName[1] = "tblSec";
	 _expandShrinkTblName[2] = "tblUserProperty";
	 _expandShrinkTblName[3] = "tblSysInfo";
	 var _expandShrinkCookieName = new Array(4);
	 _expandShrinkCookieName[0] = "icommunity_expand_shrink_status_imgContentManage"; 
	 _expandShrinkCookieName[1] = "icommunity_expand_shrink_status_imgSec";
	 _expandShrinkCookieName[2] = "icommunity_expand_shrink_status_imgUserProperty";
	 _expandShrinkCookieName[3] = "icommunity_expand_shrink_status_imgSysInfo";
	 //added by deyong Apr 13,06
	 var _expandShrinkTrId = new Array(4);
	 _expandShrinkTrId[0] = "trContentManage";
	 _expandShrinkTrId[1] = "trSec";
	 _expandShrinkTrId[2] = "trUserProperty";
	 _expandShrinkTrId[3] = "trSysInfo";
	 //added end
	 
	 function getExpandShrinkStatus()
	 {
		for(var i = 0; i < 4; i++)
		{
			var cookieName = _expandShrinkCookieName[i];
			var cookieValue = readCookie(cookieName);
			if(cookieValue == null)
				cookieValue = "Expand";
			
			//alert(cookieValue);
			var trE = document.getElementById(_expandShrinkTrId[i]);
			var imgE = document.getElementById(_expandShrinkImgName[i]);
			var tblE = document.getElementById(_expandShrinkTblName[i]);
			if(imgE != null && tblE != null)
			{
				trE.title = cookieValue=="Expand"?"Shrink":"Expand";
				imgE.alt = cookieValue=="Expand"?"Shrink":"Expand";
				expandShrinkImg(_expandShrinkTrId[i],_expandShrinkImgName[i],_expandShrinkTblName[i],"Expand","Shrink");
			}
		} 		
 	 }
 	 
	 function setExpandShrinkStatus()
	 {
		for(var i = 0; i < 4; i++)
		{
			var cookieName = _expandShrinkCookieName[i];
			var cookieValue = "Shrink";

			var e = document.getElementById(_expandShrinkImgName[i]);
			if(e != null) 
				cookieValue = e.alt;
			
			//alert(cookieValue);
			createCookie(cookieName, cookieValue, 720);			
		} 			
 		
 	 } 	 
 	 
 	 function changeimg(iframex,imgx,openx,closex)
	{
		strReplace=/'/g;
		var ActiveView = document.getElementById("txtActiveView").value;
		var Request_Id = document.getElementById("cboRequest_Status").options[document.getElementById("cboRequest_Status").selectedIndex].value;
		var Request_Status  = document.frames("iFrmREQ").document.getElementById("txtRequest_Status").value;
		
		if(document.getElementById(imgx).alt==openx)
			{
				document.getElementById(imgx).alt=closex;
				MM_swapImage(imgx,'','templates/template_current/images/Min_resize.png',1);
				
				sqlClause=document.frames("iFrmREQ").document.getElementById("txtSqlClause").value
				//.replace(strReplace,"''");
				camefromx=document.frames("iFrmREQ").document.getElementById("txtCameFrom").value;
				switch(ActiveView)
				{
					case '0':
					document.frames("iFrmREQ").location.replace("Admin/workflow/requestlist.aspx?camefrom="+camefromx+"&Pagesize=15&sqlClause="+sqlClause+"&Request_Status="+Request_Status+"&Request_Id="+Request_Id);
					break;
					
					case '1':
					document.frames("iFrmREQ").location.replace("Admin/workflow/BookingList.aspx?camefrom="+camefromx+"&Pagesize=15&sqlClause="+sqlClause+"&Request_Status="+Request_Status+"&Request_Id="+Request_Id);
					break;

				}
					document.getElementById("sControl").style.display="none";
					document.getElementById("pNews").style.display='none';
					document.getElementById("gFunctions").style.display='none';
					document.getElementById("stblSys").style.display='none';
			}
		else
			{
				document.getElementById(imgx).alt=openx;
				MM_swapImage(imgx,'','templates/template_current/images/Max_resize.png',1);
				sqlClause=document.frames("iFrmREQ").document.getElementById("txtSqlClause").value
				//.replace(strReplace,"''");
				camefromx=document.frames("iFrmREQ").document.getElementById("txtCameFrom").value;
				switch(ActiveView)
				{
					case '0':
					document.frames("iFrmREQ").location.replace("Admin/workflow/requestlist.aspx?camefrom="+camefromx+"&Pagesize=5&sqlClause="+sqlClause+"&Request_Status="+Request_Status+"&Request_Id="+Request_Id);
					break;
					
					case '1':
					document.frames("iFrmREQ").location.replace("Admin/workflow/BookingList.aspx?camefrom="+camefromx+"&Pagesize=5&sqlClause="+sqlClause+"&Request_Status="+Request_Status+"&Request_Id="+Request_Id);
					break;

				}
				document.getElementById("sControl").style.display="";
				document.getElementById("pNews").style.display="";
				document.getElementById("gFunctions").style.display="";
				document.getElementById("stblSys").style.display='';
			}
	}
	
	function expandShrinkImg(trx,imgx,tbl,expandx,shinkx)
	{
		if(document.getElementById(imgx).alt==expandx)
			{
				document.getElementById(trx).title=shinkx;
				document.getElementById(imgx).alt=shinkx;
				MM_swapImage(imgx,'','templates/template_current/images/ArrowUp.png',1);
				document.getElementById(tbl).style.display="";
			}
		else
			{
				document.getElementById(trx).title=expandx;
				document.getElementById(imgx).alt=expandx;
				MM_swapImage(imgx,'','templates/template_current/images/ArrowDn.png',1);
				document.getElementById(tbl).style.display="none";				
			}
	}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
	function DoSearch1()
	{
		document.frames("iFrmREQ").document.getElementById("txtRequest_Status").value="1";
		document.frames("iFrmREQ").document.getElementById("txtCameFrom").value="1";
		document.frames("iFrmREQ").document.getElementById("ifPaging").value="-1";
		document.frames("iFrmREQ").document.getElementById("txtRequest_Id").value=document.getElementById("cboRequest_Status").options[document.getElementById("cboRequest_Status").selectedIndex].value;
		document.frames("iFrmREQ").document.getElementById("txtRequest_Status").value="1";
		document.getElementById("txtSearch").value = "";
		document.frames("iFrmREQ").document.myForm.submit();
		return false;
	}
	function DoSearch()
	{
		strReplace=/'/g;
		document.frames("iFrmREQ").document.getElementById("txtSqlClause").value=document.getElementById("txtSearch").value.replace(strReplace,"''");
		document.frames("iFrmREQ").document.getElementById("txtCameFrom").value="1";
		document.frames("iFrmREQ").document.getElementById("ifPaging").value="-1";
		document.frames("iFrmREQ").document.getElementById("txtRequest_Id").value=document.getElementById("cboRequest_Status").options[document.getElementById("cboRequest_Status").selectedIndex].value;
		document.frames("iFrmREQ").document.getElementById("txtRequest_Status").value="-1";
		//document.frames("iFrmREQ").document.getElementById("TextBox1").value=document.getElementById("txtSearch").value;
		document.frames("iFrmREQ").document.myForm.submit();
	}
	function openWin()
	{
		var sUrl="WebMSAdvSearch.aspx?Action="+document.getElementById("txtActiveView").value;
		sUrl=sUrl;
		window.open(sUrl,'AdvancedSearch','menubar=no,address=no,scrollbars=yes,resizable=yes,top=185,left=300,width=560,height=258');////
	}
	
	function PressOnEnter()
	{
		var key=window.event.keyCode;
		if(key==13)
		{
			DoSearch();
			return false;
		}
		return true;
	}
	
	function PrintReport()
	{
		window.iFrmREQ.focus();
		window.iFrmREQ.print();
	}
	
	function ClickOnTab()
	{
		e=window.event;
		var tg = (e.target) ? e.target : e.srcElement;
		var bAction=!(tg.className=="tableTabOn");
		switch(tg.cellIndex)
		{
			case 0:
				tg.className="tableTabOn";
				tg.parentNode.cells[1].className="tableTabOff";
//				tg.parentNode.cells[2].className="tableTabOff";
				document.getElementById("txtActiveView").value=0;
				if(bAction)
				{
					document.frames("iFrmREQ").location.replace("Admin/workflow/requestlist.aspx");
					document.getElementById("cboRequest_Status").selectedIndex = 0;
					document.getElementById("txtSearch").value = "";
				}
					
			break;
			case 1:
				tg.className="tableTabOn";
				tg.parentNode.cells[0].className="tableTabOff";
//				tg.parentNode.cells[2].className="tableTabOff";
				document.getElementById("txtActiveView").value=1;
				if(bAction)
				{
					document.frames("iFrmREQ").location.replace("Admin/workflow/BookingList.aspx");
					document.getElementById("cboRequest_Status").selectedIndex = 0;
					document.getElementById("txtSearch").value = "";
				}
			break;
//			case 2:
//				tg.className="tableTabOn";
//				tg.parentNode.cells[0].className="tableTabOff";
//				tg.parentNode.cells[1].className="tableTabOff";
//				document.getElementById("txtActiveView").value=2;
//				if(bAction)
//				{
//					document.frames("iFrmREQ").location.replace("Admin/workflow/EventList.aspx");
//					document.getElementById("cboRequest_Status").selectedIndex = 0;
//					document.getElementById("txtSearch").value = "";
//				}
//			break;
		}
		
		if(bAction)
		{
			imgx="btnExpA";
			document.getElementById(imgx).alt="Maximize";//Maximize
			MM_swapImage(imgx,'','templates/template_current/images/Max_resize.png',1);
			document.getElementById("sControl").style.display="";
			document.getElementById("pNews").style.display="";
			document.getElementById("gFunctions").style.display="";
			document.getElementById("stblSys").style.display='';
		}
	}
	
	function MouseOverTab()
	{
		return;
		e=window.event;
		var tg = (e.target) ? e.target : e.srcElement
		tg = (e.target) ? e.target : e.srcElement;
		if(tg.className.toLowerCase()!="tabletabon")
		{
			tg.className+=" tableTabHL";
		}
	}
	
	function MouseOutTab()
	{
		e=window.event;
		var tg = (e.target) ? e.target : e.srcElement
		
		if(tg.className.toLowerCase()!="tabletabon")
		{
			tg.className=tg.className.replace(" tableTabHL","");
		}
		
	}
