
function popup_wh(url,windowWidth,windowHeight,bscroll){
	var name ='popup';
	myleft=(screen.width)?(screen.width-windowWidth)/2:100;

	mytop=(screen.height)?(screen.height-windowHeight)/2:100;

	properties = "width="+windowWidth+",height="+windowHeight+",scrollbars="+bscroll+", top="+mytop+",left="+myleft;

	window.open(url,name,properties)

}

function popup(url)
{
 popup_wh(url,620,520,'no');
}

	

function resize_MainTable()
      {      
         var iHeight = 0;         
         if (navigator.userAgent.indexOf("Firefox")==-1)
         {         
            iHeight = document.frames[1].document.body.scrollHeight;                 
         }
         else
         {         
           iHeight = document.getElementById("main_iframe").contentWindow.document.body.scrollHeight-20;      
     iHeight = document.getElementById("main_iframe").contentWindow.document.body.scrollHeight-20;                      
         }                 
	      document.getElementById("main_iframe").height = iHeight +"px";	      		     
      }  
      
      
      
function ChangeClass(id_objects, the_class, cont){
	
	for( i=0;i<cont;i++){
		
		document.getElementById(id_objects +i).className=the_class; 
	} 
 
 					
 		
 	

	
	
}


function validateForm(){
		var ok = true;
	
	   $$('.required').each(function(elem){
	   		
	   		if (elem.value =='' && !elem.disabled){
				elem.className ='required correct';
				ok =false;
	   		}else{
	   			elem.className ='required';
	   			
	   		}
	   	
        });
	if(!ok){
		alert('Please fill in all mandatory fields');
		
	}
        
        
	return ok;
	
}


function validateAffForm(){
	var ok = true;
	
	if ( $('email').value !=$('email2').value){
		ok =false;
		$('lblWarning').innerHTML ="Emails don't match. Please fill the same email address in the fields above.";
		
	} else if ( $('password').value !=$('password2').value){
		ok =false;
		$('lblWarning').innerHTML ="Passwords don't match. Please fill the same password in the fields above.";
		
	}  
	

	
	return ok;
}



 function startClock()
   {         
     var img = document.getElementById('HeaderRotateImgId');     
     var timer = seconds*1000;
     
     if (jss ==0 )
      {
      	timer=0;
      }
      
     if (img != null)
     { 
     if (jss > 0)
      {       
       if (document.all)    
       {
         img.style.filter="blendTrans(duration=4)";
         img.style.filter="blendTrans(duration=CrossFadeDuration)";
         img.filters.blendTrans.Apply();            
         img.filters.blendTrans.Play();                  
        }
      }
      else
      {
         jss = 1;
      }
      img.src = urlPics[jss];
      jss = jss + 1;
      if (jss > (urlPics.length-1)) jss=1;    
     }
    setTimeout("startClock()", timer);            
  }     
  
function toggleDiv(id,flagit) {
if (flagit=="1"){
if (document.layers) document.layers[''+id+''].visibility = "show"
else if (document.all) document.all[''+id+''].style.visibility = "visible"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
}
else
if (flagit=="0"){
if (document.layers) document.layers[''+id+''].visibility = "hide"
else if (document.all) document.all[''+id+''].style.visibility = "hidden"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
}
}

function showSubmenu(obj)
   {
      var childrenNodes = obj.childNodes;
	  obj.firstChild.style.color="#848484";
	  for(var i = 0, length = childrenNodes.length; i < length; i++)
	  {
         if(childrenNodes[i].className == "SubMenu")
	     {
	        childrenNodes[i].style.display = "block";
			break;
	     }//if
	  }//for
   }//showSubmenu
   
   function hideSubmenu(obj)
   {
      var childrenNodes = obj.childNodes;
	  for(var i = 0, length = childrenNodes.length; i < length; i++)
	  {
	     obj.firstChild.style.color="white";
         if(childrenNodes[i].className == "SubMenu")
	     {
	        childrenNodes[i].style.display = "none";
			break;
	     }//if
	   }//for
   }//hideSubmenu
   
   function highlightSubmenuElement(obj)
   {
      //obj.style.background = "none";
      /*obj.style.backgroundColor = "#FF7800";*/
	  obj.firstChild.style.color = "#848484";
   }//highlightSubmenuElement
   
   function unHighlightSubmenuElement(obj)
   {
      /*obj.style.background = "url('../img/bg_menu.jpg') top left repeat-x";*/
	  obj.firstChild.style.color = "white";
   }//unHighlightSubmenuElement
