//SHOW AN OBJECT BY IDfunction oShw(oNme){	window.document.getElementById(oNme).style.display = '';}	//HIDE AN OBJECT BY IDfunction oHde(oNme){	window.document.getElementById(oNme).style.display = 'none';}//HIGHLIGHTS INPUT AND TEXT FIELDSfunction BrdrChg(obj,styl,bcol){	obj.style.borderStyle = styl;	obj.style.borderWidth = '1px';	obj.style.backgroundColor = bcol;}//MINIMAL FIELD HEIGHTSfunction fldsNOTUSED(){	if(window.document.getElementById('PageTitle').type != 'hidden')		{window.document.getElementById('PageTitle').focus();}	var IDNO = 1;	while (window.document.getElementById('ptxt'+IDNO))		{			window.document.getElementById('ptxt'+IDNO).style.height = window.document.getElementById('ptxt'+IDNO).scrollHeight +6;			IDNO = IDNO + 1;		}}//NEW IMPROVED MINIMAL FIELD HEIGHTSfunction flds(){for (var i = 0; i < document.forms[0].elements.length; i++)        {      //  if (document.forms[0].elements[i].title == "fieldtst")        if (document.forms[0].elements[i].className == "FLDR")                {                document.forms[0].elements[i].style.height = document.forms[0].elements[i].scrollHeight + 6;                }        }}//ADJUST FIELD HEIGHTS TO CONTENT ON KEYUPfunction hgtAdj(obj){obj.style.height=obj.scrollHeight+6}//HOVER ON PAGE THUMBNAILSfunction slct(obj,clr){obj.style.borderColor = clr}//CHANGE A COLOR BY ID AND COLOR	function cclr1(oNme,cNme){window.document.getElementById(oNme).style.backgroundColor = cNme;}//HIDES OPEN OPTIONSfunction HOO()	{	oHde('CH_PGTBL');	cclr1('ADbt','');	oHde('PGTBL');	cclr1('PGOPbt','');	oHde('SEOTBL');	cclr1('SEOPbt','');	//oHde('ICP_TBL');	//oHde('ICPCOL_TBL');	//cclr1('IMGbt','');	//oHde('UPC_TBL');	//cclr1('UPCbt','');	}//SHOWS PAGE SELECT THUMBNAILSfunction SCPMnu(TBL,IDbt){		if (window.document.getElementById(TBL).style.display == 'none')	{		HOO();		oShw(TBL);		cclr1(IDbt,'#f2f2f2');	}	else	{	HOO();	}}	//COLLAPSE EDIT NAVfunction tgl(){	var PATHI = window.document.forms[0].PathInfo.value;	if (window.document.getElementById('E_TBL').style.display == '')		{		oHde('E_TBL');	//		window.document.getElementById('tglarr').src = PATHI + 'arr6.gif?openimageresource';		}		else		{		oShw('E_TBL');	//		window.document.getElementById('tglarr').src = PATHI + 'arr12.gif?openimageresource';				}}// VALIDATES PAGE TITLEfunction valTTL(){	if (window.document.forms[0].AltPageTitle.value != "")		{var PTID = 'AltPageTitle';}	else		{var PTID = 'PageTitle';}			var NAMID = window.document.getElementById('MenuTitle').value.toUpperCase()+window.document.getElementById(PTID).value.toUpperCase()+'LNKBG';	if (window.document.getElementById(NAMID) && (window.document.getElementById(PTID).value.toUpperCase() != window.document.forms[0].PageOnLoad.value.toUpperCase()))	{		alert("There is already a Page with this title, please rename");		if (window.document.forms[0].AltPageTitle.value != "") 			{window.document.forms[0].AltPageTitle.focus();}		else			{window.document.forms[0].PageTitle.focus();}	}}//SAVE DOCfunction SaveDoc() {	if (window.document.forms[0].AltPageTitle.value == '' && window.document.forms[0].PageTitle.value == '') 	{		alert('The Page Title and Alternative Page Title cannot be blank');		window.document.forms[0].PageTitle.focus();		return;	}			if (window.document.forms[0].MenuName.value == '') 	{		alert('The Menu cannot be blank - please check the Page Options');		return;	}		document.forms[0].FileSave.click();}//CLOSES DOC NO CHANGESfunction closeDoc() {	if (window.document.forms[0].NewDoc.value == false)	{		self.location.href = window.document.forms[0].DocLocation.value + '?OpenDocument';    		return true;		}	else	{		history.back()	}}	//CHECK VALID DATE ENTRYfunction fncIsDate(dates,type){	var err = 0	string = dates.value	var valid = "0123456789/";	var ok = "yes";	var temp;	if (string.length == 0) 	{		return 0;	}    for (var i=0; i < string.length; i++) 	{		temp = "" + string.substring(i, i+1);		if (valid.indexOf(temp) == "-1") err = 1;	}	if (string.length != 10) {err=1;}	if (string.length == 0) {err=2;}                 			if (type == 1 && err != 0) {return err;}    	if (type == 0 && err > 0) 	{ 		alert("Invalid Date eg. 10/10/2007");		return 1;	}	b = string.substring(0, 2) // day	c = string.substring(2, 3) // '/'	d = string.substring(3, 5) // month	e = string.substring(5, 6) // '/'	f = string.substring(6, 10) // year	if (d<1 || d>12) err = 1	if (c != '/') err = 1	if (b<1 || b>31) err = 1	if (e != '/') err = 1	if (f<0 || f>9999) err = 1	if (d==4 || d==6 || d==9 || d==11) 	{	if (b==31) err=1	}	if (d==2) 	{	var g=parseInt(f/4)		if (isNaN(g)) {err=1}		if (b>29) err=1 		if (b==29 && ((f/4)!=parseInt(f/4))) err=1        	}	if (type == 1 && err != 0) 	{		return 1;	}        	if (type == 0 && err != 0) 	{        		alert("Invalid Date eg. 10/10/2007");		return 1;	}   return 0;}//functions that were in Image Control Panel subform JS Header//Move functionfunction dragappmove(dragapproved){	var dragapproved=false;}function moveIT(e){	if (e)	{		if (e.button==0 && dragapproved)		{			window.document.getElementById('bgimg').style.backgroundPosition = (e.clientX-x)+' '+(e.clientY-y);			return false;		}	}	else	{		if (event.button==1 && dragapproved)		{				window.document.getElementById('bgimg').style.backgroundPosition = ((event.clientX))+' '+((event.clientY));					return false;		}	}}function drags(e){	//if (!document.all)	//return	if (!e)	{var e = event;	var obj = e.srcElement;}	else	{var obj = e.target}			//	if(obj.id == 'bgimg')//	{//var hor = window.document.forms[0].ImagePositionHor.value-0;//var vert = window.document.forms[0].ImagePositionVert.value-0;		dragapproved=true;		z=window.document.getElementById('bgimg');		x=e.clientX;			y=e.clientY;		onmousemove=moveIT();								window.document.forms[0].ImagePositionVert.value = (event.clientY); 			window.document.forms[0].ImagePositionHor.value = (event.clientX);				window.document.getElementById('bgimg').style.backgroundPosition = (y)+' '+(x);	//	}}//SCP ICP//KEYUP TESTfunction passColor(e)	{	if (e.keyCode == 13)		{		window.document.getElementById('bgimg').bgColor = window.document.getElementById('ColorRef').value		}	}	function posPic(posy,posx,ton)	{	if (window.document.forms[0].LastImagePositionID.value != '')	{		window.document.getElementById(window.document.forms[0].LastImagePositionID.value).style.backgroundColor='';	}	window.document.getElementById('bgimg').style.backgroundPosition = posy +' '+posx;	window.document.getElementById(ton).style.backgroundColor='#ffffff';	window.document.forms[0].ImagePositionVert.value = posy; 	window.document.forms[0].ImagePositionHor.value = posx;	window.document.forms[0].LastImagePositionID.value = ton;	lastSelected = ton;	}		//CHANGES COLOR BY CLICKING PALETTEfunction bgclPic(bgc)	{	if (window.document.getElementById('CLRCHNGE').checked)		{		window.document.getElementById('bgimg').bgColor= bgc.bgColor;		window.document.getElementById('ColorRef').value = bgc.bgColor;		}		else		{		window.document.getElementById('bgimgtxt').style.color= bgc.bgColor;		window.document.getElementById('TxtColorRef').value = bgc.bgColor;				}	}//DRAGfunction setImage(){	window.document.getElementById('ImagePositionHor').value = savedPositionX;	window.document.getElementById('ImagePositionVert').value = savedPositionY;	window.document.getElementById('bgimg').style.backgroundPosition = savedPositionY +' '+ savedPositionX;}function movePic1(e){	downPositionX = e.clientX;	downPositionY = e.clientY;	}function movePic2(e){		if (window.document.forms[0].EditMode.value == '1' )	{		upPositionX = e.clientX;		upPositionY = e.clientY;		newPositionX = savedPositionX + (upPositionX - downPositionX);		newPositionY = savedPositionY + (upPositionY - downPositionY);		window.document.getElementById('bgimg').style.backgroundPosition = newPositionX +' '+ newPositionY;		window.document.forms[0].ImagePositionHor.value = newPositionX;		window.document.forms[0].ImagePositionVert.value = newPositionY;		savedPositionX = newPositionX;		savedPositionY = newPositionY;	}}
