
function blockJsError(){return true;}
window.onerror = blockJsError;

function hidden()
{document.body.style.overflow='hidden';}

function unhidden()
{document.body.style.overflow='';}

function openwindow(newWin, newUrl) 
 {
    newWin = window.open(newUrl, newWin, "width=640,height=500,toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no,scrollbars=yes"); 
 	newWin.creator=self
 } 
 
 function OpenContentEditorWindow(BrandID, key, Referer) 
 {
  newUrl = "ContentEditor/edit.aspx?cnt_BrandID=" + BrandID + "&cnt_Key=" + key + "&referer=" + Referer;
    newWin = window.open(newUrl, "Content", "width=690,height=470,toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no,scrollbars=no"); 
  newWin.creator=self
 } 
 
 
 
var submitcount=0;
function checkformsubmitted()
  {         
	if (submitcount == 0)
	      {
	      submitcount++;
	      return true;
    	  }
	   else 
	      {
	      alert("This form has already been submitted... please wait as your request is processed...");
	      return false;
	      }
   }

function closeandreturn(url)
{
var HoldURL2='' + url;
window.opener.location=HoldURL2
window.close()
} 
 
function remote2(url)
{
var HoldURL2='' + url;
window.opener.location=HoldURL2
window.close()
}

 function setPointer() {
     if (document.all)
        for (var i=0;i < document.all.length; i++)
             document.all(i).style.cursor = 'wait';
 }

 function resetPointer() {
    if (document.all)
         for (var i=0;i < document.all.length; i++)
              document.all(i).style.cursor = 'default';
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=470,height=240');");
}

function popUpmed(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500');");
}

/*
Auto center window script
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
	if(win.window.focus)
		{win.window.focus();}
}

	function hidediv(DivId) 
	{
		if (document.getElementById) 
		{ // DOM3 = IE5, NS6
			document.getElementById(DivId).style.visibility = 'hidden';
			document.getElementById(DivId).style.display = 'none';
		}
		else 
		{
			if (document.layers)
			{ // Netscape 4
				document.hideShow.visibility = 'hidden';
			}
			else 
			{ // IE 4
				document.all.hideShow.style.visibility = 'hidden';
			}
		}
	}
	
	function showdiv(DivId) 
	{
		if (document.getElementById) 
		{ // DOM3 = IE5, NS6
			//alert('DOM3')
			document.getElementById(DivId).style.visibility = 'visible';
			document.getElementById(DivId).style.display = 'block';
		}
		else 
		{
			alert('Not DOM3')
			if (document.layers) 
			{ // Netscape 4
				//alert('NS4')
				document.hideShow.visibility = 'visible';
			}
			else 
			{ // IE 4
				//alert('IE4')
				document.all.hideShow.style.visibility = 'visible';
			}
		}
	}


