
function popBig(dummy){
	var win = window.open('img.asp?'+dummy,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
}
function getObj(name)
{
  if (document.getElementById)
  {
	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = document.layers[name];
	this.style = document.layers[name];
  }
}
function PopupDocument(strDocument)
{
	var wndw=window.open(strDocument,'Document','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,width='+(window.screen.width-100)+',top=40,left=40,height='+(window.screen.height-180));
}

function showPopUp(strUrl,strParams,strLink,intWidth,intHeight)
{
	var win = window.open(strUrl+'?'+strParams+'&link='+encodeURIComponent(strLink),'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+intWidth+',height='+intHeight);
}

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_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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//preload images
		var imgMMDown = new Image();
		imgMMDown.src="../../../img/right_coll.gif"
		var imgMMUp = new Image();
		imgMMUp.src="../../../img/right_exp.gif"
		
		function OnLoadProc()
		// Called by the body onload on every template.asp. Shows/positions the menubar.
			{
			if (document.frmEdit)
				if (document.frmEdit.wysiwygflag)
					objWYSIWYG.putContent(document.frmEdit.contents.value);
			if (document.getElementById('mainmenu')!=null) {
				MoveMenuBar(-1);
			}
			}
			
	
		function DoFrmEditSubmit()
			{
				if (document.frmEdit) 
					document.frmEdit.submit()
				else
					alert('ERROR: frmEdit not found');
			}
		
		function DoFrmEditSubmitITEM()
			{
				document.frmEdit.submit();
			}
			
		function ShowSelGroupPopup(intAccountID,intSiteID,strGroupName)
			{
			var win=window.open('/ast.2.2/script/edit/inc_selgroup.asp?cmd=selgroup&accountid='+intAccountID+'&siteid='+intSiteID+'&grpname='+strGroupName,'selgroup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=620,height=170,top=100,left=100');
			}
	
		function ShowHideMMDropdown()
			{
			hMenuDropdown=new getObj('mainmenudropdown')
			if (hMenuDropdown.style.display=='')
				{
				hMenuDropdown.style.display='none'
				document['MMExpColl'].src=imgMMUp.src
				}
			else
				{
				hMenuDropdown.style.display='';
				document['MMExpColl'].src=imgMMDown.src
				document.getElementById('pagesdropdown').style.visibility='hidden'
				}
			}
		
		var globalMouseOut = true;
		
		function doMouseOut(cl,table1,table2)
			{
			if(globalMouseOut)
				{
				cl.className='edittable_checkedout';document.getElementById(table1).style.display='none';document.getElementById(table2).style.display='none';
				}
			}
		function doMouseOver(cl,table1,table2)
			{
			if(globalMouseOut)
				{	
				cl.className='edittable_checkedout_hover';document.getElementById(table1).style.display='block';document.getElementById(table2).style.display='block';
				}
			}	
		var previousMenu = '';
		var previousDepth = 0;
		
		function getObject(elementName) {
			return (document.all) ? document.all[elementName] : document.getElementByID(elementName);;
		}

		function isParent(elementParent, elementChild) {
			var obj = getObject(elementChild);
			var boolFound = false;

			if (obj) {
				obj = obj.parentNode;
			
				while (obj && !boolFound) {
					if (obj.id == 'sub' + elementParent)
						boolFound = true;
						
					obj = obj.parentNode;
				}
			}
			
			return boolFound;
		}
		
		function toggleSubmenu(objMenu, intDepth) {
			var obj, obj2;
			
			if (objMenu.id) {
				/*
				if (previousMenu.length > 0) {
					if (previousDepth = intDepth) {
					//if (!isParent(previousMenu, objMenu.id)) {
						if (previousMenu != objMenu.id) {
							obj = getObject('sub' + previousMenu);
							obj2 = getObject('spacer' + previousMenu);
	
							if (obj)
								obj.style.display = 'none';
							if (obj2)				
								obj2.style.display = '';
						}
					}
				}
				*/
				
				previousMenu = objMenu.id;
				previousDepth = intDepth;
				
				var obj = getObject('sub' + objMenu.id);
				var obj2 = getObject('spacer' + objMenu.id);

				obj.style.display = (obj.style.display) ? '' : 'none';

				if (obj2)				
					obj2.style.display = (obj.style.display) ? '' : 'none';
			}
		}
		
		function hideSubMenu(element) {
			var obj = getObject('subsubmenu_' + element);
			var obj2 = getObject('spacersubmenu_' + element);
			
			if (obj)
				obj.style.display = 'none';
			if (obj2)
				obj2.style.display = '';
		}

