// JavaScript Document

/*	theURL = parent.window.location.pathname.toString();
	thePageArray = theURL.split("/");
	thePage = thePageArray[thePageArray.length-1].toUpperCase();
	if(thePage!="ADMINPORTAL.PHP")
	{
		thePageNameArray = thePage.split(".");
		thePageName      = thePageNameArray[0];
		parent.window.location.href = "adminportal.php?page="+thePageName.toLowerCase();
	}*/
	function Edit(strAction,strId,StrForm)
	{
		
		StrForm.Id.value = strId
		StrForm.FAction.value = "edit";
		StrForm.action = strAction;
		StrForm.submit();
	}
	function Viewall(strAction,strId)
	{

		document.ListForm.Id.value = strId
		document.ListForm.FAction.value = "view";
		document.ListForm.action = strAction;
		document.ListForm.submit();
	}
	function Delete(strId)
	{
		document.ListForm.Id.value = strId
		document.ListForm.FAction.value = "delete";
		document.ListForm.submit();
	}

	function gotoPage(intPage)
	{
		document.ListForm.page.value = intPage
		document.ListForm.submit();
	}
	
	function Show(strId)
	{

		document.ListForm.Search.value = strId
		document.ListForm.FAction.value = "show";
	
		document.ListForm.submit();
	}
	function View(strAction,strId)
	{
		
		document.ListForm.Id.value = strId
		document.ListForm.FAction.value = "edit";
		document.ListForm.action = strAction;
		document.ListForm.submit();
	}
	
	function MM_openBrWindow(theURL,winName,features) 
	{ 
		var hWnd =   window.open(theURL,winName,features);
		if ((document.window != null) && (!hWnd.opener))
			hWnd.opener = document.window;
	}

		function page_now(strpage)
	{
		document.ListForm.Page.value="";
				document.ListForm.action=strpage;
		document.ListForm.submit();
	}
	
	function jump_now(strpage)
	{
		var disp;
		var count=document.ListForm.Page.value%5
		var pages=0;
		pages=parseInt(document.ListForm.Page.value);
		if(count==0)
			disp=pages+1;
		else
			disp=document.ListForm.Page.value-(count-1);
		
		document.ListForm.Display.value = disp;
		document.ListForm.action=strpage;
		document.ListForm.submit();
	}
	function getPopupX(popupx){
		PopupLeft    = (screen.width-popupx)/2;
		return PopupLeft;
	}
	function getPopupY(popupy){
		PopupTop     = (screen.height-popupy)/2;
		return PopupTop;
	}
	function popupwindows(strid,strwidth,strheight,strpopx,strpopy)
	{
	
	strX=getPopupX(strpopx);
	strY=getPopupY(strpopy)
	ct=window.open('pop-email.php?id='+strid, 'cart', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=no,width='+strwidth+',height='+strheight+',left ='+strX+',top ='+strY);
	ct.focus();
	}
	function popupHelp(strid,strwidth,strheight,strpopx,strpopy)
	{
	
	strX=getPopupX(strpopx);
	strY=getPopupY(strpopy)
	ct=window.open('pop-help.php?helpid='+strid, 'cart', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=no,width='+strwidth+',height='+strheight+',left ='+strX+',top ='+strY);
	ct.focus();
	}
	
	function popupTemplates(strid,strvalue,strwidth,strheight,strpopx,strpopy)
	{
	
	strX=getPopupX(strpopx);
	strY=getPopupY(strpopy)
	ct=window.open('pop-help.php?helpid='+strid+'&str='+strvalue, 'cart', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=no,width='+strwidth+',height='+strheight+',left ='+strX+',top ='+strY);
	ct.focus();
	}
	
	function popupCat(strid,strwidth,strheight,strpopx,strpopy)
	{
	
	strX=getPopupX(strpopx);
	strY=getPopupY(strpopy)
	ct=window.open('pop-category.php', 'Rev', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=no,width='+strwidth+',height='+strheight+',left ='+strX+',top ='+strY);
	ct.focus();
	}
	
	function popupRes(strid,strwidth,strheight,strpopx,strpopy)
	{
	
	strX=getPopupX(strpopx);
	strY=getPopupY(strpopy)
	ct=window.open('pop-restrict.php', 'Rev', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=no,width='+strwidth+',height='+strheight+',left ='+strX+',top ='+strY);
	ct.focus();
	}

	function popupAdmin(strid,strwidth,strheight,strpopx,strpopy)
	{
	
	strX=getPopupX(strpopx);
	strY=getPopupY(strpopy)
	ct=window.open('admin-popup.php?id='+strid, strid, 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=no,width='+strwidth+',height='+strheight+',left ='+strX+',top ='+strY);
	ct.focus();
	}
	function popupLink(strid,strwidth,strheight,strpopx,strpopy)
	{
	
	strX=getPopupX(strpopx);
	strY=getPopupY(strpopy)
	ct=window.open('edit-link.php?id='+strid, strid, 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=no,width='+strwidth+',height='+strheight+',left ='+strX+',top ='+strY);
	ct.focus();
	}
	function popup(strid,strwidth,strheight,strpopx,strpopy)
	{
	
	strX=getPopupX(strpopx);
	strY=getPopupY(strpopy)
	ct=window.open('pop-linkdetail.php?id='+strid, 'cart', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=no,width='+strwidth+',height='+strheight+',left ='+strX+',top ='+strY);
	ct.focus();
	}
	function ShowHelp(div, title, desc)
	{
	div = document.getElementById(div);
	div.style.display = 'inline';
	div.style.position = 'absolute';
	div.style.width = '200';
	div.style.backgroundColor = 'FAFAFF';
	div.style.border = 'dashed 1px black';
	div.style.padding = '10px';
	div.innerHTML = '<b>' + title + '</b><br><img src=images/blank.gif width=1 height=5><br><div style="padding-left:10; padding-right:5">' + desc + '</div>';
	}
function HideHelp(div)
				{
					div = document.getElementById(div);
					div.style.display = 'none';
				}