<!--
// Check whether string s is empty.

                              		  
var ns6=document.getElementById && !document.all;

function restrictinput(maxlength, e, placeholder)
{
   if (window.event&&event.srcElement.value.length >= maxlength)
      return false;
   else
   if (e.target && (e.target==eval(placeholder)) && (e.target.value.length >= maxlength))
   {
      var pressedkey=/[a-zA-Z0-9\.\,\/]/; //detect alphanumeric keys
      if (pressedkey.test(String.fromCharCode(e.which)))
         e.stopPropagation();
   }
}


function countlimit(maxlength,e,placeholder)
{
   var theform=eval(placeholder);
   var lengthleft=maxlength-theform.value.length;
   var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder);
   if (window.event||e.target&&e.target==eval(placeholder))
   {
      if (lengthleft < 0)
         theform.value=theform.value.substring(0,maxlength);
         placeholderobj.innerHTML=lengthleft;
   }
}


function displaylimit(theform, msg, thelimit)
{
   var limit_text=msg+': <b><span id="'+theform.toString()+'">'+thelimit+'</span></b> ';
   if (document.all||ns6) document.write(limit_text);
   if (document.all)
   {
      eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)};
      eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)};
   }
   else if (ns6)
   {
      document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
      document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
   }
}


function isEmpty(s)
{   
return ((s == null) || (s.value.length == 0));
}


function checkString(theField)
{   
    if (theField.value.length <= 2) return false;  
    return true;
}


function isEmail(s)
{
    if (s==null ||s.value.length<=2) return false;
  
    var sLength = s.value.length;

    if (s.value.indexOf('@') <= 0) return false;
    if (s.value.indexOf('@') >=sLength-1) return false;
    if (s.value.indexOf('.') <= 0) return false;
    if (s.value.indexOf('.') >=sLength-1) return false;
    if (s.value.indexOf(' ') != -1) return false;
    return true;
}


function formFocus(fobj, bkcolor, forecolor, bordercolor) {
	if (document.all) {
		fobj.style.backgroundColor = bkcolor;
		fobj.style.color = forecolor;
		fobj.style.border= "1 solid " + bordercolor;
	}
}

function formBlur(fobj, bkcolor, forecolor) {
	if (document.all) {
		fobj.style.backgroundColor = bkcolor;
		fobj.style.color = forecolor;
		fobj.style.border= "1 inset";
	}
}


if (document.images) {
	form_submiton = new Image();  form_submiton.src = template_images_lang_path+'button_submitON.gif';
	form_submitoff= new Image();  form_submitoff.src= template_images_lang_path+'button_submitOFF.gif';
	form_submitdown= new Image();  form_submitdown.src= template_images_lang_path+'button_submitDOWN.gif';

	form_confirmon = new Image();  form_confirmon.src = template_images_lang_path+'button_confirmON.gif';
	form_confirmoff= new Image();  form_confirmoff.src= template_images_lang_path+'button_confirmOFF.gif';
	form_confirmdown= new Image();  form_confirmdown.src= template_images_lang_path+'button_confirmDOWN.gif';
	form_reseton  = new Image();  form_reseton.src  = template_images_lang_path+'button_resetON.gif';
	form_resetoff = new Image();  form_resetoff.src = template_images_lang_path+'button_resetOFF.gif';
	form_resetdown = new Image();  form_resetdown.src = template_images_lang_path+'button_resetDOWN.gif';
	form_modifyon  = new Image();  form_modifyon.src  = template_images_lang_path+'button_modifyON.gif';
	form_modifyoff = new Image();  form_modifyoff.src = template_images_lang_path+'button_modifyOFF.gif';
	form_modifydown = new Image();  form_modifydown.src = template_images_lang_path+'button_modifyDOWN.gif';
}

function form_imgSwap(imgName, ext) {
	if (document.images)
		document[imgName].src= eval(imgName + ext);
}

function imgOn(imgName) {form_imgSwap(imgName, 'on.src');}
function imgOff(imgName) {form_imgSwap(imgName, 'off.src');}
function imgDown(imgName) {form_imgSwap(imgName, 'down.src');}

//-->