
function min_chars_req(v)
{
	//alert(v.length);
}
function xxx(v)
{
	
	tmp=document.getElementById('zipcode'); 
	//tmp1=document.getElementById('city_state'); 
	tmp1=document.getElementById('city_state'); 
	//alert(v);
	if(v!='USA')
	{
		tmp1.style.display = "block"; 	
		tmp.style.display = "none"; 	
	}
	else
	{
		tmp.style.display = "block"; 	
		tmp1.style.display = "none"; 	
	}
	

}

function doSearch(base,id)
{
			
		//alert(base);
		//alert(document.getElementById('UserZip').value);
		var id=document.getElementById('UserZipcodeId').value;
		if(id.length==5 || id.length==9)
		{
			new Ajax.Updater('city_state',base+'/users/zip/'+id,{ frequency: 0,
			asynchronous:true, evalScripts:true}); 
		}
		else
		{
			//x.innerHTML="Please Enter Valid Zipcode";
			x=document.getElementById("city_state");
			x.innerHTML="";
		
		}
}

function city_uszip(country)
{
	var zip=document.getElementById('zipcode'); 
	var city=document.getElementById('city_state'); 
	
	//div_or=document.getElementById('div_or');
	var statecombo=document.getElementById('statecombo');
	var citycombo=document.getElementById('citycombo');
	//schoolcombo=document.getElementById('schoolscombo');
	//school_not_shown_link= document.getElementById('school_not_shown');
	
	
	
	if(country!="USA")
	{
	
		document.getElementById('UserZipcode').value="";
		document.getElementById('UserCity').value="";
		
		/* combobox manipulation  */
		//div_or.style.display = "none";		
		statecombo.style.display = "none";
		citycombo.style.display = "none";
		//school_not_shown_link.style.display = "none";
		//schoolcombo.style.display = "none";
		
		
		city.style.display = "block"; 	
		
		document.getElementById('UserCity').focus();
		zip.style.display = "none"; 
	}
	else
	{
		
		document.getElementById('UserCity').value="";
		
		/* combobox manipulation  */
		//div_or.style.display = "block";		
		//school_not_shown_link.style.display="block";
		statecombo.style.display = "block";
		citycombo.style.display = "block";
		
		//schoolcombo.style.display = "block";
		
		city.style.display = "none"; 	
		zip.style.display = "block"; 	
		//document.getElementById('UserZipcode').focus();
	}
	
}


function state_city_school(country)
{
	//zip=document.getElementById('zipcode'); 
	var city=document.getElementById('city_state'); 
	
	//div_or=document.getElementById('div_or');
	var statecombo=document.getElementById('statecombo');
	var citycombo=document.getElementById('citycombo');
	//schoolcombo=document.getElementById('schoolscombo');
	 var school_not_shown_link= document.getElementById('school_not_shown');
	
	//alert("dsfgdsf");
//	alert(country);
	if(country!="USA")
	{
	
		//document.getElementById('UserZipcode').value="";
		document.getElementById('UserCity').value="";
		
		/* combobox manipulation  */
		//div_or.style.display = "none";		
		statecombo.style.display = "none";
		citycombo.style.display = "none";
		school_not_shown_link.style.display = "none";
		//schoolcombo.style.display = "none";
		
		
		city.style.display = "block"; 	
		
		document.getElementById('UserCity').focus();
		//zip.style.display = "none"; 
	}
	else
	{
		
		document.getElementById('UserCity').value="";
		
		/* combobox manipulation  */
		//div_or.style.display = "block";		
		school_not_shown_link.style.display="block";
		statecombo.style.display = "block";
		citycombo.style.display = "block";
		
		//schoolcombo.style.display = "block";
		
		city.style.display = "none"; 	
		//zip.style.display = "block"; 	
		//document.getElementById('UserZipcode').focus();
	}
	
}

function city_uszipcode(country)
{

	var zip=document.getElementById('zipcode'); 
	var city=document.getElementById('city_state'); 
	//div_or=document.getElementById('div_or');
	//statecombo=document.getElementById('statecombo');
	//citycombo=document.getElementById('citycombo');
	//schoolcombo=document.getElementById('schoolscombo');
	
	
	
	if(country!="USA")
	{
		//	alert(country);
		document.getElementById('UserZipcode').value="";
		//document.getElementById('UserCity').value="";
		
		/* combobox manipulation  */
		//div_or.style.display = "none";		
		//statecombo.style.display = "none";
		//citycombo.style.display = "none";
		//schoolcombo.style.display = "none";
		
		
		city.style.display = "block"; 	
		
		//document.getElementById('UserCity').focus();
		zip.style.display = "none"; 
	}
	else
	{
		
		document.getElementById('UserCity').value="";
		
		/* combobox manipulation  */
		//div_or.style.display = "block";		
		//statecombo.style.display = "block";
		///citycombo.style.display = "block";
		//schoolcombo.style.display = "block";
		
		city.style.display = "none"; 	
	    zip.style.display = "block"; 	
		//document.getElementById('UserZipcode').focus();
	}
	
}
function myvalue()
{
	 
	 var t=document.getElementById('StudentCelebritycategoryId');
	 var abc=new Array();
	 var len =  t.options.length;
	 var selIndex = t.selectedIndex;
	 var id = t.value;
	 var x=0;
		
		for (i=0; i<len; i++){
			if(t.options[i].selected)
			{
	 			abc[x]=t.options[i].value;	
				x=x+1;
			}
		}
		
	
	 if(abc.length == 0 || selIndex==0)
	 {
		 document.getElementById('first_div').style.display = "none";
		 document.getElementById('second_div').style.display = "none";
		 document.getElementById('third_div').style.display = "none";
	 }
	 else if(abc.length == 1)
	 {
		 
		 
	new Ajax.Request('../ajax/getcategory/', {
		  method: 'post',parameters: 'category_id='+id, 
		  onSuccess: function(transport) {
			  if (!transport.responseText.match("false"))
			  {
				// var restex_arr = new array(); 
				 var  restxt = transport.responseText;
				var restex_arr = restxt.split(',');
				
				document.getElementById('cat_person').innerHTML=restex_arr[0];
				document.getElementById('cat_activity1').innerHTML=restex_arr[1];
				document.getElementById('cat_activity2').innerHTML=restex_arr[1];
			  	document.getElementById('first_div').style.display = "block";
			  }
		
		  }
});
		 
  		// document.getElementById('second_div').style.display = "none";
		// document.getElementById('third_div').style.display = "none";

	 }else if(abc.length == 2){
		   document.getElementById('first_div').style.display = "block";
  		 document.getElementById('second_div').style.display = "block";
		 document.getElementById('third_div').style.display = "none";
		 
     }else if(abc.length == 3){
		  document.getElementById('first_div').style.display = "block";
  		 document.getElementById('second_div').style.display = "block";
		 document.getElementById('third_div').style.display = "block";
		 
	 }else if(abc.length > 3){
	     alert("You can not select more then 3 category");	 
	 }
	 
	
}

function x1(v)
{ 
	//alert(v);
	tmp1=document.getElementById('photo_div'); 
	tmp2=document.getElementById('video_div');
	if(v==2)
	{
			
		//alert(v);
		tmp1.style.display = "none"; 
		tmp2.style.display = "block"; 
	}
	else if(v==1)
	{
		
		tmp1.style.display = "block"; 
		tmp2.style.display = "none"; 
	}
	
		

	
}


 function myselect(val)
 {
   	if(val=='Enter Search text...') document.getElementById('UserSearch').value=''; 
 }
 function checkblur(blrval)
 {
    if(blrval=='') document.getElementById('UserSearch').value='Enter Search text...';
  }
  
  function emailselect(val)
 {
   	if(val=='Enter New Email Address') document.getElementById('newemail').value=''; 
 }
 function emailblur(blrval)
 {
    if(blrval=='') document.getElementById('newemail').value='Enter New Email Address';
  }
  function check_radio()
  {
	   $chk = document.getElementById('newfirstmail');
	if($chk.checked == false)
	{
		document.getElementById('newfirstmail').checked= true;
	}
  }
  function school_validate(val)
  {
	  	newschool(val);
  }
  
  function setvalue_newschool(val)
  {
	   
	  if(val=='add')
	  {
		
		document.getElementById('newschoolfield').style.display = "block";
	  }
	  else
	   	document.getElementById('newschoolfield').style.display = "none";
	  
  }
  
  function newschool(val)
  {
	   
	  if(val=='add')
	  {
		document.getElementById('UserSchool').value="";  	
		document.getElementById('newschoolfield').style.display = "block";
 	    //document.getElementById('new_school_label').style.display = "block";
	  }
	  else
	  {//alert(val);
	  	if(document.getElementById('newschoolfield').style.display == "block")
		{
		document.getElementById('newschoolfield').style.display = "none";
		}
	   	
 	    //document.getElementById('new_school_label').style.display = "none";
	  }//alert('dfsgdfgsdfgs');
	  
  }
  
   function addnewschool(val)
   {
	   
	  if(val=='add')
	  {
		document.getElementById('UserSchool').value="";  	
		document.getElementById('newschoolfield').style.display = "block";
	  }
	  else
	   	document.getElementById('newschoolfield').style.display = "none";
	  
  }
  