	//<!--
	
	var should_reload = false;
	window.onfocus=maybe_reload;
	
	function popedit(id, count, type)
	{
		var width;
		var height;
		var scrollbars=0;

		switch(type)
		{
			case 0:
				url = 'htmleditor/editor.php?id='+id;
		    width = 520;
		    height = 310;
				break;
			case 1:
				url = 'editimage.php?id='+id+'&_ipath='+_ipath;
		    width = 270;
		    height = 400;
				scrollbars=1;
				break;
			case 2:
				url = 'editlink.php?id='+id;
		    width = 530;
		    height = 100;
				break;
			case 3:
				url = 'editmenu.php?id='+id;
		    width = 400;
		    height = 140  + (25 * count);
				if(height > (screen.height - 200))
				{
					height = screen.height - 200;
					scrollbars=1;
				}
				break;
			case 31:
				url = 'editsub.php?id='+id;
		    width = 370;
		    height = 140  + (25 * count);
				if(height > (screen.height - 200))
				{
					height = screen.height - 200;
					scrollbars=1;
				}
				break;
			case 32:
				url = 'editsub.php?id='+id;
		    width = 610;
		    height = 140  + (25 * count);
				if(height > (screen.height - 200))
				{
					height = screen.height - 200;
					scrollbars=1;
				}
				break;
			case 4:
				url = 'editnews.php?id='+id;
		    width = 600;
		    height = 390;
				break;
			case 5:
				url = 'editclients.php?id='+id;
		    width = 600;
		    height = 350;
				break;
			case 6:
				url = 'uploadimg.php?id='+id;
		    width = 400;
		    height = 40;
				break;
		}
		var left = (screen.width - width)/2;
		var top = (screen.height - height)/2;
		
		should_reload = true;
		eval('window.open("'+_fpath+url+'", "popwin", "toolbar=0,scrollbars='+scrollbars+',location=0,status=0,directories=0,menubar=0,resizable=1,width='+width+',height='+height+',left='+left+',top='+top+'");');
		return false;
	}

	function maybe_reload()
	{
		if(should_reload)
		{
			document.location.href = document.location;
			should_reload = false;
		}
	}

	function MM_reloadPage(init) {  //reloads the window if Nav4 resized
		if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
		else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
	MM_reloadPage(true);

	var myTimeout=new Array();
	var mySubMenus=new Array();

	function getAnchorPosition(anchor)
	{
		var coords=new Object();
		var el, ol, ot;

		if(anchor.x)
		{
			coords.x = anchor.x;
			coords.y = anchor.y;
		}
		else
		{
			el = anchor;
			ol=el.offsetLeft;
			while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
			coords.x = ol;
			el = anchor;
			ot=el.offsetTop;
			while ((el=el.offsetParent) != null) { ot += el.offsetTop; }
			coords.y = ot;
		}
		return coords;
	}

	function popmenu(submenu)
	{
		var i, x;
		var coords = new Object();

		hideallmenus(submenu);
		mySubMenus[mySubMenus.length] = submenu;

		if(myTimeout[submenu])
			clearTimeout(myTimeout[submenu]);
		if(window.event)
			srcElm = window.event.srcElement;
		else
			srcElm = event.currentTarget;
		coords = getAnchorPosition(srcElm);
		var menu=document.getElementById(submenu);
		menu.style.left=coords.x + 3;
		menu.style.top=coords.y + 17;
		menu.style.visibility="visible";
	}

	function hidemenu(submenu)
	{
		var current, related;

		if (window.event)
		{
			current = document.getElementById(submenu);
			related = window.event.toElement;
		}
		else
		{
			current = event.currentTarget;
			related = event.relatedTarget;
		}
		if (current != related && !contains(current, related))
			myTimeout[submenu] = setTimeout('document.getElementById("'+submenu+'").style.visibility = "hidden";',100);
	
	}

	function hideallmenus(submenu)
	{
		for(i = 0; i < mySubMenus.length; i++)
		{
			if(mySubMenus[i] != submenu)
				document.getElementById(mySubMenus[i]).style.visibility = "hidden";
		}
	}
	
	function contains(a, b)
	{

		// Return true if node a contains node b.

		while (b.parentNode)
			if ((b = b.parentNode) == a)
				return true;
		return false;
	}

	function invalidUser(form)
	{
		form.user.value="";
		form.pwd.value="";
		alert('Invalid User');
		return false;
		}

	function flipcell(elmnt)
	{
		if (elmnt.className)
		{
			 if (elmnt.className=="drophi") 
					elmnt.className="droplo";
			 else
					elmnt.className="drophi";
		}
	}

	function regenerate(){
	window.location.reload()
	}
	function regenerate2(){
	if (document.layers){
	setTimeout("window.onresize=regenerate",450)
	intializescroller()
	}
	}

	function intializescroller(){
	document.vscroller01.document.vscroller02.document.write(scrollercontents)
	document.vscroller01.document.vscroller02.document.close()
	thelength=document.vscroller01.document.vscroller02.document.height
	scrollit()
	}

	function scrollit(){
	if (document.vscroller01.document.vscroller02.top>=thelength*(-1)){
	document.vscroller01.document.vscroller02.top-=speed
	setTimeout("scrollit()",100)
	}
	else{
	document.vscroller01.document.vscroller02.top=scrollerheight
	scrollit()
	}
	}

	function fullscreen()
	{
		window.resizeTo(screen.width, screen.height - 25);
		window.moveTo(0,0);
	}

	function isEmail(theForm,strFieldName,strMsg){
			var objFormField = theForm.elements[strFieldName]
			var strEmail = objFormField.value;
			var bolValid = true;
					 if(strEmail.length < 7){
					 bolValid = false;
					 }
					 if(strEmail.lastIndexOf(" ") >0){
					 bolValid = false;
					 }
					 var intLastDot = strEmail.lastIndexOf(".")
					 if(intLastDot == -1 ||  strEmail.length - intLastDot >4){
					 bolValid = false;
					 }
					 var intAt = strEmail.lastIndexOf("@")
					 if(intAt == -1 ||  strEmail.length - intAt < 5){
					 bolValid = false;
					 }
					 if(!bolValid){
								 alert("- "+ strMsg +" is Required.\n");
								objFormField.focus();
					 }
			return bolValid;
	}

	// -->
