
function windowwidth() 
{
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth-16;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth-20;
	 }
	}
	return winW;
}

function windowheight() 
{
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winH = window.innerHeight-16;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winH = document.body.offsetHeight-20;
	 }
	}
	return winH;
}

function popitup(url,name,features) {
	var newwindow = (window.open(url,name,features));
	if (window.focus) {newwindow.focus()}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function rollback(uniqueID, version)
{
	if (confirm("WARNING:  Are you sure you wish to rollback to the earlier time?\n\nThe current version will become Backup Position 1 and any subsequent backups will be placed in the next available position up to the rollback point selected.\n\nNo versions will be lost but ordering will change, please note time/author stamps.")) {
		document.location = 'record_rollback.php?uniqueID='+uniqueID+'&version='+version;
	}
}

function checkspace(entered)
{
	with(entered) {
		var strSrc = value;
        //here we need to give the string/char that we need to replace from source string
        //in my case it is space for I gave a space between two forward slashes as var spaceFix = / /gi;
        //if you want to replace for example all "a" then it should be written as var spaceFix = /a/gi;
        
		//substitute space with underscore
		var spaceFix = / /gi;
        var strDest = strSrc.replace(spaceFix,"-");
        
		//remove all except numbers/letters/underscores
		spaceFix = /[^a-zA-Z0-9_-]/gi;
        strDest = strDest.replace(spaceFix,"");
        
		value = strDest;
        return false;
	}
}

function checkspace2(entered)
{
	with(entered) {
		var strSrc = value;
        //here we need to give the string/char that we need to replace from source string
        //in my case it is space for I gave a space between two forward slashes as var spaceFix = / /gi;
        //if you want to replace for example all "a" then it should be written as var spaceFix = /a/gi;
        
		//substitute space with underscore
		var spaceFix = / /gi;
        var strDest = strSrc.replace(spaceFix,"");
        
		//remove all except numbers/letters/underscores
		spaceFix = /[^a-zA-Z0-9]/gi;
        strDest = strDest.replace(spaceFix,"");
        
		value = strDest;
        return false;
	}
}

function validpassword2(entered) {
	with(entered) {
	  // var testpass = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/;   at least one upper, one lower and one number || visit: http://www.the-art-of-web.com/javascript/validate/1/
		var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/; 
		var validPassword = re.test(entered);
		if(validPassword) {
			alert("Good");
		}
	}
}


// proper function
function validpassword(entered) {
	with(entered) {
		var re1 = /[a-z]+/i; // at least one letter (case INsensitive)
		//var re2 = /[0-9]+/; // at least one number
		var re3 = /[a-zA-Z0-9]{8,40}/; // only letters and numbers between 6 and 40 characters
		
		if ((!re1.test(entered.value)) /*|| (!re2.test(entered.value))*/ || (!re3.test(entered.value)))  {
			return false;
		}
		else {
			return true;
		}
	}
}

function validusername(entered) {
	with(entered) {
		var re1 = /[a-zA-Z0-9_-]{6,40}/; // only letters and numbers between 6 and 40 characters
		
		if ((!re1.test(entered.value)))  {
			return false;
		}
		else {
			return true;
		}
	}
}

function yes() 
{
	if(webAddressDiv.style.visibility=='visible') {
	webAddressDiv.style.visibility='hidden';
	}
	else {
	webAddressDiv.style.visibility='visible';
	}
}


function checkNavStatus1()
{
	if (document.addrecordform.topNav.checked)
	{
		document.addrecordform.parentID.selectedIndex = 2;
		webAddressDiv.style.visibility = 'visible';
		subNavLinkDiv.style.visibility = 'hidden';
	}
	else 
	{
		document.addrecordform.parentID.selectedIndex = 0;
		document.addrecordform.webAddress.value = "";
		webAddressDiv.style.visibility = 'hidden';
		subNavLinkDiv.style.visibility = 'visible';
	}
}

function checkNavStatus2()
{
	if (document.addrecordform.parentID.selectedIndex == 2 || document.addrecordform.parentID.selectedIndex == 3)
	{
		document.addrecordform.topNav.checked = true;
	}
	else 
	{
		document.addrecordform.topNav.checked = false;
	}
}

function orderformchange(uniqueID) 
{
	document.orderform.hiddenid.value = uniqueID;
	document.orderform.submit();
}

function deletePic(uniqueID, picNumber, table)
{
	if (confirm("WARNING:  "+picNumber+"\n\nAre you sure you wish to delete this picture")) {
		document.location = 'pic_delete.php?table='+table+'&id='+uniqueID+'&pic='+picNumber;
	}
}


function confirmDelete(table, id, arg, querystring, action) 
{
	if (action=="delete")
	{
		if (confirm("WARNING:  "+arg+"\n\nAre you sure you wish to delete this record entirely")) {
			document.location = 'record_delete.php?table='+table+'&id='+id+'&action='+action+'&query='+querystring;
		}
	}
	else if (action=="remove")
	{
		if (confirm("WARNING:  "+arg+"\n\nAre you sure you wish to remove this record from the CMS")) {
			document.location = 'record_delete.php?table='+table+'&id='+id+'&action='+action+'&query='+querystring;
		}
	}
}

function confirmLocking(table, id, arg, querystring) 
{
	if (confirm("WARNING:  "+arg+"\n\nAre you sure you wish to change the locking status of this account")) {
		document.location = 'record_userlock.php?table='+table+'&id='+id+'&query='+querystring;
	}
}

function emptyvalidation(entered)
{
with (entered)
{
if (value==null || value=="" || value==0)
{return false;}
else {return true;}
}
} 

function emailvalidation(entered)
{
with(entered)
{
// var emailFilter=/^.+@.+\..{2,3}$/;
//alternate email filter (more simple)
var emailFilter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (!(emailFilter.test(value))) 
{
	return false;
}
else
{
	return true;
}
}
}

function newsaddform()
{
var err = 0;
var msg = "Error:\n\nThe following fields are mandatory and are missing or incorrect:-\n\n";
if (emptyvalidation(document.newsadd.title)==false) {err++; msg+="Title\n";};
//if (emptyvalidation(document.newsadd.description)==false) {err++; msg += "Description\n";};

if (err!=0) 
{
	alert (msg);
	return false;
}
} 

function contentaddform()
{
var err = 0;
var msg = "Error:\n\nThe following fields are mandatory and are missing or incorrect:-\n\n";
if (emptyvalidation(document.addrecordform.title)==false) {err++; msg+="Page Title\n";};

if (err!=0) 
{
	alert (msg);
	return false;
}
} 


function settingsaddform()
{
var err = 0;
var msg = "Error:\n\nThe following fields are mandatory and are missing or incorrect:-\n\n";
//if (emptyvalidation(document.addrecordform.webAddress)==false) {err++; msg+="Web address\n";};
if (emptyvalidation(document.addrecordform.subNavLink)==false) {err++; msg+="Top/Sub Level Navigation Status\n";};

if (err!=0) 
{
	alert (msg);
	return false;
}
} 


function firstloginsubmit()
{
var err = 0;
var msg = "Error:\n\nThe following fields are mandatory and are missing or incorrect:-\n\n";
//if (emptyvalidation(document.addrecordform.webAddress)==false) {err++; msg+="Web address\n";};
if (emptyvalidation(document.getElementById("firstloginform").password)==false) {err++; msg+="Password\n";};
if (emptyvalidation(document.getElementById("firstloginform").password2)==false) {err++; msg+="Re enter Password\n";};
if (document.getElementById("firstloginform").password.value!=document.getElementById("firstloginform").password2.value) {err++; msg+="Entries do not match\n";};


if (err!=0) 
{
	alert (msg);
	return false;
}
} 



function pageaddsubmit1()
{
var err = 0;
var msg = "Error:\n\nThe following fields are mandatory and are missing or incorrect:-\n\n";
//if (emptyvalidation(document.addrecordform.webAddress)==false) {err++; msg+="Web address\n";};
if (emptyvalidation(document.addrecordform.subNavLink)==false) {err++; msg+="Top/Sub Level Navigation Status\n";};
if (emptyvalidation(document.addrecordform.webAddress)==false) {err++; msg+="Web Address\n";};

if (err!=0) 
{
	alert (msg);
	return false;
}
} 

function useraddsubmit()
{
var err = 0;
var msg = "Error:\n\nThe following fields are mandatory and are missing or incorrect:-\n\n";
//if (emptyvalidation(document.addrecordform.webAddress)==false) {err++; msg+="Web address\n";};
if (emptyvalidation(document.addrecordform.username)==false) {err++; msg+="Username\n";};
if (emptyvalidation(document.addrecordform.password)==false) {err++; msg+="Password\n";};
//if (emailvalidation(document.addrecordform.useremail)==false) {err++; msg+="Email\n";};
//if (emptyvalidation(document.addrecordform.firstname)==false) {err++; msg+="First Name\n";};
//if (emptyvalidation(document.addrecordform.lastname)==false) {err++; msg+="Last Name\n";};
if (emptyvalidation(document.addrecordform.access)==false) {err++; msg+="User Group\n";};

if (err!=0) 
{
	alert (msg);
	return false;
}
} 

function pageaddsubmit2(webAddress)
{
var err = 0;
var msg = "Error:\n\nThe following fields are mandatory and are missing or incorrect:-\n\n";
//if (emptyvalidation(document.addrecordform.webAddress)==false) {err++; msg+="Web address\n";};
if (emptyvalidation(document.addrecordform.title)==false) {err++; msg+="Page Title\n";};

if (err!=0) 
{
	alert (msg);
	return false;
}

if(webAddress==document.addrecordform.title.value) {
	if(confirm('****Attention\n\nDefault page title has not been changed. Is this correct?')) {
		return true;
	}
	else {
		return false;
	}
}
} 

function pageaddsubmit3()
{
var err = 0;
var msg = "Error:\n\nThe following fields are mandatory and are missing or incorrect:-\n\n";
//if (emptyvalidation(document.addrecordform.webAddress)==false) {err++; msg+="Web address\n";};
if (emptyvalidation(document.addrecordform.title)==false) {err++; msg+="Page Title\n";};
if (emptyvalidation(document.addrecordform.picture)==true && emptyvalidation(document.addrecordform.pictureURL)==true) {err++; msg+="EITHER upload a picture OR specify address, NOT both\n";};

if (err!=0) 
{
	alert (msg);
	return false;
}
} 

function pageaddsubmit4()
{
var err = 0;
var msg = "Error:\n\nThe following fields are mandatory and are missing or incorrect:-\n\n";
//if (emptyvalidation(document.addrecordform.webAddress)==false) {err++; msg+="Web address\n";};
if (emptyvalidation(document.addrecordform.title)==false) {err++; msg+="Course Title\n";};
if (emptyvalidation(document.addrecordform.category)==false || document.addrecordform.category.value=="addnewcategory" && emptyvalidation(document.addrecordform.newcategory)==false) {err++; msg+="Course Category\n";};

if (err!=0) 
{
	alert (msg);
	return false;
}
} 

function pageaddsubmit5()
{
var err = 0;
var msg = "Error:\n\nThe following fields are mandatory and are missing or incorrect:-\n\n";
//if (emptyvalidation(document.addrecordform.webAddress)==false) {err++; msg+="Web address\n";};
if (emptyvalidation(document.addrecordform.category)==false || document.addrecordform.category.value=="addnewcategory" && emptyvalidation(document.addrecordform.newcategory)==false) {err++; msg+="Document Category\n";};
if (emptyvalidation(document.addrecordform.documentUpload)==false && emptyvalidation(document.addrecordform.docLink)==false) {err++; msg+="Document Upload or Link not present\n";};
if (emptyvalidation(document.addrecordform.documentUpload)==true && emptyvalidation(document.addrecordform.docLink)==true) {err++; msg+="Document Upload or Link - not both\n";};

if (err!=0) 
{
	alert (msg);
	return false;
}
} 

function errorOverlap()
{
if(document.errorCheck.error.value=="error")
{
	alert("ERROR  -  update NOT completed\n\nBooking details conflict with current booking");
	document.errorCheck.error.value = "";
}
}


function daysinmonth(day, month, year) //test for valid days in month ie not 31 days in feb/apr/june/sept/nov
{
if (month=="04" || month=="06" || month=="09" || month=="11")
{
	if (day=="31")
	{
		return false;
	}
	else
	{
		return true;
	}
}
else if (month=="02") //february test + leap year check
{
	if (day>"28" && (year%4)!=0)
	{
		return false;
	}
	else if (day>"29" && (year%4)==0)
	{
		return false;
	}
}
else
{
	return true;
}
}


































// List Cascade Menu (04-Mar-2006)
// by Vic Phillips http://www.vicsjavascripts.org.uk

// Add Functionality to a List defined in the HTML Code
// Clicking a List Item will toggle the display of child UL list items
// and hide other UL list items.
// There may be as many levels in the list as required.

// With optional persistence to retain the last display when a visitor revisits.
// List item images may be specified and may be toggled with the display.
// List Items may also be connected with lines in the form of a menu tree.

// There may be as many applications on a page as required.

// Application Notes

// **** The HTML Code
//
// The list is defined in the HTML Code and does not require any special attributes
// but must be contained in a parent element  with a unique ID name.
// e.g.
//  <div id="test1" >
//   <ul >
//     <li>Tom0</li>
//      <ul >
//       <li>Dick0</li>
//        <ul >
//         <li>Dick00</li>
//           <ul id="d3">
//            <li>Dick000</li>
//            <li>Dick001</li>
//           </ul>
//         <li>Dick01</li>
//           <ul >
//            <li>Dick0000</li>
//            <li>Dick0010</li>
//           </ul>
//        </ul>
//       <li>Dick1</li>
//           <ul >
//            <li>Dick1000</li>
//            <li>Dick1010</li>
//           </ul>
//      </ul>
//     <li>Tom1
//   </ul>
//  </div>
//
// Event calls and links may be added to the code as required.

// **** Initialisation
//
// The script would normally be initialised from a <BODY> or window onload event
// e.g.
// <body onload="zxcInitList('test1',null,null);" >
// where:
// parameter 0 = the unique ID name of the parent element of the List (string)
// parameter 1 = is required if images are to be used.
// parameter 2 = is required if lines are to be used.

// ***** Item Images
//
// List item images may be specified and may be toggled with the display.
// Three images must be specified in an array
// field 0 = a standard (non toggling) image                                      (string)
// field 1 = display child UL image to be displayed when the child UL is hidden.  (string)
// field 2 = hide    child UL image to be displayed when the child UL is visible. (string)
//
// This array is assigned the second parameter of the initialisation call
// e.g. <body onload="zxcInitList('test',['right.gif','down.gif','up.gif'])" >

// **** Lines
//
// List Items may also be connected with lines in the form of a menu tree.
// If lines are used the parent elements must have a style
// display of 'display:absolute;' or  'display:relative;'
// and a style width of a width appropriate to the extended List
//
// The line attributes are defined in an array
// field 0 = the line type (solid, dotted, etc)  (string)
// field 1 = the line color                      (string)
// field 2 = the horizontal(X) line offset.      (digits)
// field 3 = the vertical(Y)   line offset.      (digits)
//
// This array is assigned the third parameter of the initialisation call
// e.g. <body onload="zxcInitList('test',['right.gif','down.gif','up.gif'],['dotted','black',10,8]);zxcInitList('test1',null,['dotted','black',10,10]);" >

// **** General
//
// All variable, function etc. names are prefixed with 'zxc' to minimise conflicts with other JavaScripts
// These characters are easily changed to characters of choice using global find and replace.

// The functional code(about 6K) is best as an external JavaScript

// Tested with IE6 and Mozilla FireFox

// Customising Variables

var zxcDays=1; // The List Menu display states will be available on revisits for a specified number of days

// Functional Code - NO NEED to Change

var zxcCursor='pointer'
if (document.all){ zxcCursor='hand'; }
var zxcExp=new Date(new Date().getTime()+zxcDays*86400000).toGMTString();

function zxcInitList(zxcid,zxcsimg,zxcline){
 zxcsimg=zxcsimg||['','',''];
 zxcp=document.getElementById(zxcid);
// zxcp.ary fields - 0 = id, 1 = .nu, 2 = line attributes, 3 = displayed items, 4 = line objects, 5 on = master LIs
 zxcp.ary=[zxcp,[],zxcline,[],[]];
 var zxcary=[];
 var zxcels=zxcp.getElementsByTagName('*')||zxcp.all;
 for (var zxc0=0;zxc0<zxcels.length;zxc0++){
  if (zxcels[zxc0].tagName.toUpperCase()=='LI'){
   zxcels[zxc0].style.listStyleImage='url('+zxcsimg[0]+')';
   zxcAddEvent(zxcels[zxc0],'zxcDisplay','click');
  }
  if (zxcels[zxc0].tagName.toUpperCase()=='UL'||zxcels[zxc0].tagName.toUpperCase()=='LI'){
   zxcary.push(zxcels[zxc0]);
  }
  if (zxcels[zxc0].tagName.toUpperCase()=='UL'){
   zxcels[zxc0].ary=[];
  }
  if (zxcels[zxc0].tagName.toUpperCase()=='LI'){
   zxcels[zxc0].parentNode.ary.push(zxcels[zxc0]);
  }
 }
 for (var zxc1=1;zxc1<zxcary.length;zxc1++){
  if (zxcary[zxc1].tagName.toUpperCase()=='UL'&&zxcary[zxc1-1].tagName.toUpperCase()=='LI'){
   zxcary[zxc1-1].slave=zxcary[zxc1];
   zxcary[zxc1-1].nu=zxc1;
   zxcp.ary.push(zxcary[zxc1-1]);
   zxcary[zxc1-1].ary=zxcp.ary;
   zxcary[zxc1-1].style.cursor=zxcCursor;
  }
 }
 for (var zxc2=5;zxc2<zxcp.ary.length;zxc2++){
  zxcp.ary[zxc2].level=0;
  zxcobj=zxcp.ary[zxc2];
  while (zxcobj.parentNode!=zxcp){
   zxcp.ary[zxc2].level++;
   zxcobj=zxcobj.parentNode;
  }
  zxcp.ary[zxc2].slave.level=zxcp.ary[zxc2].level;
  zxcp.ary[zxc2].slave.style.display='none';
  zxcp.ary[zxc2].img=zxcsimg;
  zxcp.ary[zxc2].style.listStyleImage='url('+zxcsimg[1]+')';
 }
 if (zxcGetCookie(zxcid)){
  zxcookie=zxcGetCookie(zxcid).split('|');
  for (var zxc4=0;zxc4<zxcookie.length;zxc4++){
   for (var zxc5=5;zxc5<zxcp.ary.length;zxc5++){
    if (zxcp.ary[zxc5].nu==zxcookie[zxc4]){
     zxcp.ary[zxc5].slave.style.display='';
     zxcp.ary[1].push(zxcp.ary[zxc5].nu);
     zxcp.ary[zxc5].style.listStyleImage='url('+zxcsimg[2]+')';
    }
   }
  }
  zxcSetFormCookie(zxcid,zxcp.ary[1].join('|'));
 }
 if (zxcp.ary[2]&&window['zxcLines']){
  zxcLines(zxcp.ary);
 }
}

function zxcDisplay(zxce){
 zxce.cancelBubble=true;
 if (zxce.stopPropagation){ zxce.stopPropagation(); }
 if (!this.slave){ return; }
 if (this.slave.style.display=='none'){
  this.slave.style.display='';
  this.ary[1].push(this.nu);
  this.style.listStyleImage='url('+this.img[2]+')';
 }
 else {
  this.slave.style.display='none';
  this.ary[1]=this.ary[1].remove(this.nu);
  this.style.listStyleImage='url('+this.img[1]+')';
 }
 for (var zxc0=5;zxc0<this.ary.length;zxc0++){
  if (this.ary[zxc0]!=this&&this.ary[zxc0].slave.level>=this.level){
   this.ary[zxc0].slave.style.display='none';
   this.ary[1]=this.ary[1].remove(this.ary[zxc0].nu);
   this.ary[zxc0].style.listStyleImage='url('+this.img[1]+')';
  }
 }
 zxcSetFormCookie(this.ary[0].id,this.ary[1].join('|'));
 if (this.ary[2]&&window['zxcLines']){
  zxcLines(this.ary);
 }
}

function zxcLines(zxcary){
 zxcary[3]=[];
 for (var zxc0=5;zxc0<zxcary.length;zxc0++){
  if (zxcary[zxc0].slave.style.display!='none'){
   zxcary[3].push(zxcary[zxc0]);
  }
 }
 for (var zxc7=0;zxc7<zxcary[4].length;zxc7++){
  zxcary[0].removeChild(zxcary[4][zxc7]);
 }
 zxcary[4]=[];
 var zxcbrd=(zxcary[2][0]+' '+zxcary[2][1]+' 1px')
 zxcdv=zxcMakeEle('DIV',{position:'absolute',overflow:'hidden',width:'2px',height:'100px',borderLeft:zxcbrd});
 zxcary[0].appendChild(zxcdv);
 zxcdh=zxcMakeEle('DIV',{position:'absolute',overflow:'hidden',width:'100px',height:'2px',borderTop:zxcbrd});
 zxcary[0].appendChild(zxcdh);
 var zxcdvc,zxcdhc;
 for (var zxc8=0;zxc8<zxcary[3].length;zxc8++){
  zxcdvc=zxcdv.cloneNode(false);
  zxcary[0].appendChild(zxcdvc);
  zxcary[4].push(zxcdvc);
  zxcdvc.style.left=(zxcary[3][zxc8].offsetLeft-zxcary[2][2])+'px';
  zxcdvc.style.top=(zxcary[3][zxc8].offsetTop+zxcary[2][3]*2)+'px';
  zxcdvc.style.height=(zxcary[3][zxc8].slave.ary[zxcary[3][zxc8].slave.ary.length-1].offsetTop-zxcary[3][zxc8].offsetTop-zxcary[2][3])+'px';
  for (var zxc9=0;zxc9<zxcary[3][zxc8].slave.ary.length;zxc9++){
   zxcdhc=zxcdh.cloneNode(false);
   zxcary[0].appendChild(zxcdhc);
   zxcary[4].push(zxcdhc);
   zxcdhc.style.left=zxcdvc.style.left;
   zxcdhc.style.top=(zxcary[3][zxc8].slave.ary[zxc9].offsetTop+zxcary[2][3])+'px';
   zxcdhc.style.width=(zxcary[3][zxc8].slave.ary[zxc9].offsetLeft-zxcdvc.offsetLeft-zxcary[2][2]*2)+'px';
  }
 }
 zxcary[0].removeChild(zxcdv);
 zxcary[0].removeChild(zxcdh);
}

function zxcMakeEle(zxctype,zxcstyle){
 var zxcele=document.createElement(zxctype);
 if (zxcstyle){
  for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
 }
 return zxcele;
}

Array.prototype.remove=function(zxcremi){
 for (this.i=0;this.i<this.length;this.i++){
  if (this[this.i]==zxcremi){
   this.splice(this.i,1);
  }
 }
 return this;
}

function zxcEventAdd(zxco,zxct,zxcf) {
 if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ zxco[zxcf](e);}, false); }
 else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ zxco[zxcf](e); }); }
 else {
  var zxcPrev=zxco["on" + zxct];
  if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
  else { zxco['on'+zxct]=zxco[zxcf]; }
 }
}

function zxcAddEvent(zxc,zxcfun,zxcevt){
 if (zxc.addEvent){ return; }
 zxc.addEvent=window[zxcfun];
 zxcEventAdd(zxc,zxcevt,'addEvent');
}

function zxcGetCookie(zxcnme){
 var zxcst=document.cookie.indexOf(zxcnme+"=");
 var zxclen=zxcst+zxcnme.length+1;
 if ((!zxcst)&&(zxcnme != document.cookie.substring(0,zxcnme.length))) return null;
 if (zxcst==-1) return null;
 var zxcend=document.cookie.indexOf(";",zxclen);
 if (zxcend==-1) zxcend=document.cookie.length;
 return decodeURI(document.cookie.substring(zxclen,zxcend));
}

function zxcSetFormCookie(zxcnme,zxcval){
 if (!zxcDays){ return; }
 document.cookie=zxcnme+"="+encodeURI(zxcval)+";expires="+zxcExp+";path=/;"
}
