function validChars(e) 
{ 
  var charCode = (e.which) ? e.which : window.event.keyCode; 
  if (charCode <= 255) { 
    return false; 
  }
}

function reload(form){
  if (document.forms["brec"]) {
	  var val=form.id3.options[form.id3.options.selectedIndex].value; 
    self.location="cmsIndex.php?id1=2&id2=1&sid=A&id3=" + val ;
	}
	if (document.forms["arec"]) {
		var tval=form.type.value;
		var var1=form.dept.value;
	  var val=form.prov.options[form.prov.options.selectedIndex].value;
    self.location="index.php?asset=1&dept=" + var1+ "&type=" + tval + "&prov=" + val ;
	}
	if (document.forms["prec"]) {
	  var val=form.prov.options[form.prov.options.selectedIndex].value;
    var val1=form.pimg.value;
    var val2=form.pimga.value;
    self.location="cmsIndex.php?id1=16&sid=A&prov=" + val + "&pimg=" + val1 + "&pimga=" + val2 ;
	}
	if (document.forms["cprec"]) {
	  var val=form.prov.options[form.prov.options.selectedIndex].value;
    var val1=form.pimg.value;
    var val2=form.pimga.value;
		var val3=form.bank.options[form.bank.options.selectedIndex].value;
    self.location="cmsIndex.php?id1=20&sid=A&prov=" + val + "&pimg=" + val1 + "&pimga=" + val2 + "&bank=" + val3 ;
	}
}

function validNum(e) 
{ 
  var charCode = (e.which) ? e.which : window.event.keyCode; 
  if (charCode <= 13) { 
    return true; 
  }
  else { 
    var keyChar = String.fromCharCode(charCode); 
    var re = /[0-9.,]/ 
    return re.test(keyChar); 
  } 
}

function enableField() {
  if (document.istats.agree.checked)
    document.istats.cont.disabled=false;
	else
	  document.istats.cont.disabled=true;
}

function handleError() {
	return true;
}
window.onerror=handleError;

function setFocus(form) {
  if (document.forms["complaint"])
		form.submit.focus();
  if (document.forms["survey"])
		form.submit.focus();
 if (document.forms["orderform"])
		document.form.submit.focus();
// if (document.forms["calculator"])
//		document.forms["calculator"].elements["next"].focus();
}

function disableEnterKey(e) {
  var key;
  if(window.event)
    key = window.event.keyCode;     //IE
  else
    key = e.which;     //firefox
  if(key == 13)
    return false;
  else
    return true;
}


if (document.images) {
   pic1on= new Image(205,35);
   pic1on.src="template/resource2.jpg";  
   pic2on= new Image(205,35);
   pic2on.src="template/assets2.jpg";
   pic3on= new Image(205,35);
   pic3on.src="template/decal2.jpg";  
   pic4on= new Image(205,35);
   pic4on.src="template/ecomplaint2.jpg";
   pic5on= new Image(205,35);
   pic5on.src="template/bid2.jpg";
   pic6on= new Image(205,35);
   pic6on.src="template/wisesaver2.jpg";  
   pic7on= new Image(205,35);
   pic7on.src="template/links2.jpg";  
   pic8on= new Image(205,35);
   pic8on.src="template/citizenscharter2.jpg";  

   pic1off= new Image(205,35);
   pic1off.src="template/resource1.jpg";  
   pic2off= new Image(205,35);
   pic2off.src="template/assets1.jpg";  
   pic3off= new Image(205,35);
   pic3off.src="template/decal1.jpg";  
   pic4off= new Image(205,35);
   pic4off.src="template/ecomplaint1.jpg";  
   pic5off= new Image(205,35);
   pic5off.src="template/bid1.jpg";  
   pic6off= new Image(205,35);
   pic6off.src="template/wisesaver1.jpg";  
   pic7off= new Image(205,35);
   pic7off.src="template/links1.jpg";  
   pic8off= new Image(205,35);
   pic8off.src="template/citizenscharter1.jpg";  
}

function lightup(imgName) {
  if (document.images) {
    imgOn=eval(imgName + "on.src");
    document[imgName].src= imgOn;
  }
}

function turnoff(imgName) {
  if (document.images) {
    imgOff=eval(imgName + "off.src");
    document[imgName].src= imgOff;
  }
}

// This script and many more are available free online at -->
// The JavaScript Source!! http://javascript.internet.com -->
// Original:  Premshree Pillai (premshree@hotmail.com ) -->
// Web Site:  http://www.qiksearch.com -->
// Begin


window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" 
 && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" 
 && bVer < 4);
 var blink_speed=600;
 var i=0;
 
if (NS4 || IE4) {
 if (navigator.appName == "Netscape") {
 layerStyleRef="layer.";
 layerRef="document.layers";
 styleSwitch="";
 }else{
 layerStyleRef="layer.style.";
 layerRef="document.all";
 styleSwitch=".style";
 }
}

//BLINKING
function Blink(layerName){
 if (NS4 || IE4) { 
 if(i%2==0)
 {
 eval(layerRef+'["'+layerName+'"]'+
 styleSwitch+'.visibility="visible"');
 }
 else
 {
 eval(layerRef+'["'+layerName+'"]'+
 styleSwitch+'.visibility="hidden"');
 }
 } 
 if(i<1)
 {
 i++;
 } 
 else
 {
 i--
 }
 setTimeout("Blink('"+layerName+"')",blink_speed);
}
//  End -->
