function submitForm(form){
	document.forms[form].submit();
}

function setInputAtrr(formId){
	
	var frm      = document.getElementById(formId);
	for (var i=0;i<frm.length;i++) {
		//		row.setAttribute("id", "row"+j); onblur="" onfocus=""
				frm[i].onblur     = doValidate
				frm[i].onfocus    = doFocus;
	}
	
}

/* onblur element validate */
function doValidate(){   

 //this.style.background="#ffffff";
  this.style.border='1px #CCCCCC solid';
  
 if (this.offsetParent.tagName=="TD")
  this.offsetParent.style.background="#323232";
}

/* onfocus element validate */
function doFocus(){
  
   //this.style.background="#f2f2f2";
   this.style.border='1px #000000 solid';
   
  //alert( findPosY(this)  );
  //alert(  $('validate_layer').style.zIndex);
  //$('validate_layer').style.top  = findPosY(this) + 'px';
  //$('validate_layer').style.left = findPosX(this) +300+ 'px';
	if (this.offsetParent.tagName=="TD")
	this.offsetParent.style.background="#e2e2e2";
}

/* POPUP Window center position  */
function popupSize(h,w){
	var winl = (screen.width-w)/2;
	  var wint = (screen.height-h)/2;
	  if (winl < 0) winl = 0;
	  if (wint < 0) wint = 0;
	  var settings = 'height=' + h + ',';
	  settings += 'width=' + w + ',';
	  settings += 'top=' + wint + ',';
	  settings += 'left=' + winl + ',';
	return settings;
}


function setImageBtns(div_id){

	var btns = document.getElementById(div_id);	
	var imgs = btns.getElementsByTagName('IMG');
		for(var i=0; i<imgs.length; i++)
		{	
			imgs[i].className='input-image';
		    imgs[i].onmouseover=function(){this.className='input-image-hover';};
			imgs[i].onmouseout=function(){this.className='input-image';};
			imgs[i].onmousedown=function(){this.className='input-image-down'}
			imgs[i].onmouseup=function(){this.className='input-image-hover'}
			
		}
    btns = null;
	imgs = null;	
}



function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }



  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }


startList = function()
{
if (document.all&&document.getElementById)
{
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++)
{
node = navRoot.childNodes[i];
if (node.nodeName=="LI")
{
node.onmouseover=function()
{
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
