/*GLOBAL VARIABLE*/

var periodicalFormCheckerEventExp=null;

var initExperienceIndex=function(){	
	periodicalFormCheckerEventExp=checkExperienceIndex.periodical(1000);	
//	$('regbean.isInternational').addEvent('change',toogleIsInternational);
//	$('stateId').addEvent('change',toogleIsState);	
};

var toogleIsInternational=function(){
	if($('regbean.isInternational').checked==true){
		$('stateId').disabled=true;
	}else{
		$('stateId').disabled=false;
	}
};


var toogleIsState=function(){
	if($('stateId').value!=''){
		$('regbean.isInternational').disabled=true;
		$('regbean.country').disabled=true;		
	}else{
		$('regbean.isInternational').disabled=false;
		$('regbean.country').disabled=false;
	}
};

var checkExperienceIndex=function(){
	var isValid=true;
  	if($('classId').value==''){
		isValid=false;
  	}
//  	
//  	if($('stateId').value==''&&$('regbean.isInternational').checked==false){
//  		isValid=false;
//  	}
  	if(isValid)
  	{
  		enableExpButton(true);
  	}
  	else
  	{
  		enableExpButton(false);
  	}
  	return isValid;
};

 var enableExpButton=function(status){
  	if(status){
  		if($('banggBtn').getProperty('disabled')==true){
  			$('banggBtn').setProperty('disabled',false);
  			$('banggBtn').setStyle('background-image','url('+$('webContextString').getProperty('value')+'passive/images/continue.png)');
  			
  		}
  	}else{
  		if($('banggBtn').getProperty('disabled')==false){
  			$('banggBtn').setProperty('disabled',true);
  			$('banggBtn').setStyle('background-image','url('+$('webContextString').getProperty('value')+'passive/images/continue-dull.png)');  			
  		}
  	}
  };
