function validateMethod()
{ var f=document.form2;
   	if(re())
		{	document.form2.submit();
		    
		}else{
			f.email_notification.focus();
		return false;
		}
}

function fPopup(url) {


window.open( "Registration/checkUserId.jsp?username="+document.getElementById("user_name").value, "myWindow", "status = 1, height = 300, width = 300, resizable = 0" )

}

function MM_openBrWindow(theURL,winName,features,checktype)
	{
var docF=document.frmPage1
window.open()
	}



//Mani Ajax
var xmlHttp;
	var ReturnVal="";

function ajaxFunction(Value,DisplayAtDiv,id)
  {
	
	try
	{    // Firefox, Opera 8.0+, Safari    
	
		xmlHttp=new XMLHttpRequest();    

	}
		catch (e)
		{    // Internet Explorer   
			try
			{    
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
			}
			catch (e)
			{   
				try
					{   
						xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
					}
				catch (e)
				{       
					alert("Your browser does not support AJAX!");        return false;        
				}      
			}   

		}

		
		
		xmlHttp.open("GET","remotescripting.jsp?userid=" + Value+"&id="+id ,true);
		Statechng(DisplayAtDiv);
		xmlHttp.send(null);

		document.getElementById(DisplayAtDiv).innerHTML = ReturnVal
	}

var TimerOut;
function Statechng(DisplayAtDiv)
		{
		if(xmlHttp.readyState==4)
			{
			
		var temp =	escape(xmlHttp.responseText)
			temp = temp.replace(/%0D/g,"")
			temp = temp.replace(/%09/g,"")
			temp = temp.replace(/%0A/g,"")
				document.getElementById(DisplayAtDiv).innerHTML = unescape(temp); //xmlHttp.responseText;
				clearTimeout(TimerOut);	
			}
		else
			{

			TimerOut = setTimeout("Statechng('"+DisplayAtDiv +"');"  ,100)
				
			}
		}
//Mani AJAX End

function lo(){
	document.form2.created.focus();
	}

function re()
{
	   
	
var f=document.form2;
var created=f.created.value;
var user=f.user_name.value;
var name_str=new RegExp("^[a-z][a-zA-Z0-9_. ]+$","ig");
var name_str1=new RegExp("^[a-z][a-zA-Z0-9_.]+$","ig");
var pass=f.password.value;
var pass1=f.verify_password.value;
var pass_str=new RegExp("^[a-zA-Z0-9_@.][a-zA-Z0-9_@.]+$","ig");

var salit1=f.salitation.value;
var name1_str=new RegExp("^[a-zA-Z.]+$","ig");
var first=f.first_name.value;
var second=f.second_name.value;
var last=f.last_name.value;

	if(created==""){
	alert("Please select Posted By");
	f.created.focus();
	return false;
	}
	var reff=f.refferal_code.value;
	var ref_str=new RegExp("^[a-z][a-zA-Z0-9]+$","ig");
	if(f.refferal_code.value!=""){
		if(!reff.match(ref_str))
	   	{
		     document.getElementById('refdispid').innerHTML="Referral Code not acceptable! Please use characters ranging from (a-z)(A-Z)(0-9) and Referral Code should start with a character."; 
			 clearErrorMessage('refdispid');
		  	 f.refferal_code.foucs();
		     return false;    
	   	}
		if(document.getElementById("CheckMsg2").innerHTML!=""){
		     document.getElementById('refdispid').innerHTML="Refferal Code not Exist"; 
			 clearErrorMessage('refdispid');
		     f.refferal_code.select(); 
		     return false;    
	   }
	}
   if(user=="")
	{
		document.getElementById('logdispid').innerHTML="Please enter your desired Login Name";
		clearErrorMessage('logdispid');
		f.user_name.select();
		return false;
	}
 	if(user.length<4)
  	{
	    document.getElementById('logdispid').innerHTML="Login name not valid! Login name should have atleast 4 characters and atmost 15 characters";
		clearErrorMessage('logdispid');
	    f.user_name.select(); 
	    return false; 
	}
	if(user.length>15)
  	{
	    document.getElementById('logdispid').innerHTML="Login name not valid! Login name should have atleast 4 characters and atmost 15 characters";
		clearErrorMessage('logdispid');
	    f.user_name.select(); 
	    return false; 
  	}
  	if(!user.match(name_str1))
   	{
	     document.getElementById('logdispid').innerHTML="Login name not acceptable! Please use characters ranging from (a-z)(A-Z)(0-9)( ._) and login name should start with a character."; 
		 clearErrorMessage('logdispid');
	   	 f.user_name.select();
	     return false;    
  	}
 //MANI validation 

 	if(document.getElementById("CheckMsg").innerHTML!=""){
     clearErrorMessage('');
     f.user_name.select(); 
     return false;    
   }
 
 //MANI validation END
	if(pass=="")
	{
		document.getElementById('pasdispid').innerHTML="Please type your password";
		clearErrorMessage('pasdispid');
		f.password.select();
		return false;
	}
	if(!pass.match(pass_str))
	{
	    document.getElementById('pasdispid').innerHTML="Password not acceptable! Please use characters ranging from (a-z)(A-Z)(0-9)(_@.)"; 
		clearErrorMessage('pasdispid');
	   	f.password.select();
	    return false;    
	 }
if(pass.length<6)
{
    document.getElementById('pasdispid').innerHTML="Password not valid! Password should have atleast 6 characters and atmost 12 characters";
	 clearErrorMessage('pasdispid');
    f.password.select(); 
    return false; 
  }
if(pass.length>12)
{
    document.getElementById('pasdispid').innerHTML="Password not valid! Password should have atleast 6 characters and atmost 12 characters";
	 clearErrorMessage('pasdispid');
    f.password.select(); 
    return false; 
  }
  if(user==pass)
	  {
    document.getElementById('pasdispid').innerHTML="Your Login name & Password cannot be identical for security reasons. Please change your Login name or your Password.";
	 clearErrorMessage('pasdispid');
    f.password.select(); 
    return false; 
  }

if(pass1=="")
{
document.getElementById('repdispid').innerHTML="Please type your password again.";
 clearErrorMessage('repdispid');
f.verify_password.select();
return false;
}
if(!pass1.match(pass_str))
 {
     document.getElementById('repdispid').innerHTML="Confirm password not acceptable! Please use characters ranging from (a-z)(A-Z)(0-9)(_@.)"; 
	  clearErrorMessage('repdispid');
    f.verify_password.select();
     return false;    
   }
if(pass1.length<6)
{
    document.getElementById('repdispid').innerHTML="Password not valid! Password should have atleast 6 characters and atmost 12 characters";
	 clearErrorMessage('repdispid');
    f.verify_password.select(); 
    return false; 
  }
if(pass1.length>12)
{
    document.getElementById('repdispid').innerHTML="Password not valid! Password should have atleast 6 characters and atmost 12 characters";
	 clearErrorMessage('repdispid');
    f.verify_password.select(); 
    return false; 
  }
if(pass!=pass1)
{
document.getElementById('repdispid').innerHTML="Passwords not matching! Please use identical Passwords in both the form fields.";
 clearErrorMessage('repdispid');
f.verify_password.select();
return false;
}

var email=f.email.value;
var email1=f.cemail.value;

var len=email.length;
var len1=email1.length;
var email_re=new RegExp("^[a-z][a-z0-9._@]+$","g");
var email1_re=new RegExp("^[a-z][a-z0-9._@]+$","g");

if(!email.match(email_re)){
document.getElementById('emadispid').innerHTML="Improper Email address format. Please enter a valid Email address.";
clearErrorMessage('emadispid');
f.email.select();
return false;
}
var count=0;
for(var i=0;i<=len;i++)
{
if(email.charAt(i)=="@"){
count++;
}
}
if((count==0) || (count>=2)){

	document.getElementById('emadispid').innerHTML="Improper Email address format. Please enter a valid Email address.";
	clearErrorMessage('emadispid');
	f.email.select();
	return false;
}
 
if(!email1.match(email_re)){
document.getElementById('cemdispid').innerHTML="Improper Email address format. Please confirm with a valid Email address.";
clearErrorMessage('cemdispid');
f.cemail.select();
return false;
}
var count1=0;
for(var i=0;i<=len;i++){
if(email1.charAt(i)=="@"){
count1++;
}
}
if((count1==0) || (count1>=2)){
document.getElementById('cemdispid').innerHTML="Improper Email address format. Please confirm with a valid Email address.";
clearErrorMessage('cemdispid');
f.cemail.select();
return false;
}

if(document.getElementById("CheckMsg1").innerHTML!="")
   { 
    clearErrorMessage('');
     f.email.select(); 
     return false;    
   }
 //MANI validation END
  
if(f.email.value != f.cemail.value)
{
document.getElementById('cemdispid').innerHTML="Email addresses not matching!. Please use identical email addresses in both the form fields.";
clearErrorMessage('cemdispid');
f.cemail.select();
return false;
}
 if(f.gender[0].checked==false && f.gender[1].checked==false){
document.getElementById('gendispid').innerHTML="Please select the gender";
clearErrorMessage('gendispid');
f.gender[0].focus();
return false;
}

  if(salit1=="")
{
document.getElementById('saldispid').innerHTML="Please select Salutation";
clearErrorMessage('saldispid');
f.salitation.focus();
return false;
}
if(f.gender[0].checked==true){
if(f.salitation.value=="mrs" || f.salitation.value=="ms"){
document.getElementById('saldispid').innerHTML="Salutation Mismatch! Please select proper Salutation";
clearErrorMessage('saldispid');
f.salitation.focus();
return false;
}
}

if(f.gender[1].checked==true){
if(f.salitation.value=="mr"){
document.getElementById('saldispid').innerHTML="Salutation Mismatch! Please select proper Salutation";
clearErrorMessage('saldispid');
f.salitation.focus();
return false;
}
}
if(first=="First Name")
{
document.getElementById('namdispid').innerHTML="Please enter your First Name";
clearErrorMessage('namdispid');

f.first_name.select();
return false;
}
if(!first.match(name1_str))
{
document.getElementById('namdispid').innerHTML="First name not acceptable! Please use characters ranging from (a-z)(A-Z)(.) and first name should start with a character.";
clearErrorMessage('namdispid');

f.first_name.select();
return false;
}
if(first.length<4)
{
document.getElementById('namdispid').innerHTML="First name not valid! First name should have atleast 4 characters and atmost 50 characters";
clearErrorMessage('namdispid');

f.first_name.select();
return false;
}
if(first.length>50)
{
document.getElementById('namdispid').innerHTML="First name not valid! First name should have atleast 4 characters and atmost 50 characters";
clearErrorMessage('namdispid');
f.first_name.select();
return false;
}
if(f.second_name.value!=""&&f.second_name.value!="Middle Name")
{		if(!second.match(name1_str))
		{
		document.getElementById('namdispid').innerHTML="Middle name not acceptable! Please use characters ranging from (a-z)(A-Z)(.) and middle name should start with a character.";
		clearErrorMessage('namdispid');
		f.second_name.select();
		return false;
		}
	}
	
if(last!="Last Name" && !last.match(name1_str))
{
document.getElementById('namdispid').innerHTML="Last name not acceptable! Please use characters ranging from (a-z)(A-Z)( .) and last name should start with a character.";
clearErrorMessage('namdispid');

f.last_name.select();
return false;
}

if(last.length>25)
{
document.getElementById('namdispid').innerHTML="Last name not valid! Last name should have atleast 2 characters and atmost 25 characters";
clearErrorMessage('namdispid');
f.last_name.select();
return false;
}
if(f.date1.value==""){
document.getElementById('selectdate').innerHTML="Please select your Date of Birth............";
clearErrorMessage('selectdate');
f.last_name.select();
return false;
}

 if((document.getElementById("age2").value<18)&&(document.getElementById("age2").value!="")){
	  document.getElementById('detdispid').innerHTML="Age should be greater than 18 years";
	  clearErrorMessage('detdispid');
	  f.last_name.select();
	  return false;
  }
  
  
  var ph_val=new RegExp("^[0-9][0-9]+$","ig");
  
  if((f.ctr_code.value == "" && f.area_code.value== "" &&  f.ph_no.value == "") && f.mobile_no.value==""){
	document.getElementById('phodispid').innerHTML="Please enter your Phone number or Mobile number";
  	clearErrorMessage('phodispid');
	f.ctr_code.select();
	return false;
  }
  
  
  
  
if(f.mobile_no.value==""&&f.ctr_code.value=="")
{
  			
  				document.getElementById('phodispid').innerHTML="Please Enter Country code.";
  				clearErrorMessage('phodispid');
				f.ctr_code.select();
				return false;
 }
if(f.ctr_code.value!="")
{			var va=f.ctr_code.value;
  				if(!va.match(ph_val))
  				{
  				document.getElementById('phodispid').innerHTML="Please Enter valid country code.";
  				clearErrorMessage('phodispid');
				f.ctr_code.select();
				return false;
				}
 }
if(f.mobile_no.value==""&&f.area_code.value=="")
{
		document.getElementById('phodispid').innerHTML="Please Enter Area code.";
		clearErrorMessage('phodispid');
		f.area_code.select();
		return false;
}
if(f.area_code.value!="")
{			var va=f.area_code.value;
  				if(!va.match(ph_val))
  				{
  				document.getElementById('phodispid').innerHTML="Please Enter valid Area code.";
  				clearErrorMessage('phodispid');
				f.ctr_code.select();
				return false;
				}
 }
if(f.mobile_no.value==""&&f.ph_no.value=="")
{
		document.getElementById('phodispid').innerHTML="Please Enter Phone Number.";
		clearErrorMessage('phodispid');
		f.ph_no.select();
		return false;
}
if(f.ph_no.value!="")
{			    var va=f.ph_no.value;
  				if(!va.match(ph_val))
  				{
  				document.getElementById('phodispid').innerHTML="Please Enter valid Phone Number.";
  				clearErrorMessage('phodispid');
				f.ctr_code.select();
				return false;
				}
 }

var mo_val=new RegExp("^[1-9][0-9]+$","ig");
if(f.mobile_no.value!="")
{		var x = f.mobile_no.value;
		if(!x.match(mo_val))
		{	
			document.getElementById('mobdispid').innerHTML="Please Enter Valid Mobile Number.";
			clearErrorMessage('mobdispid');
			f.ph_no.select();
			return false;
		}
}

if(document.getElementById('CheckMsg7').innerHTML!="")
  {
    document.getElementById('CheckMsg7').innerHTML="Land Line Number Already Exists,Please provide onther"  
    f.ctr_code.select();
    return false;
  
  }
  
  if(document.getElementById('CheckMsg6').innerHTML!="")
  {
    document.getElementById('CheckMsg6').innerHTML="Mobile Number Already Exists,Please provide onther"
    f.mobile_no.select();
    return false;
  
  }

	
  	
  
var line=f.line1.value;
var line_str=new RegExp("^[a-zA-Z0-9.,-/#][a-z A-Z0-9.,-/#]+$","ig");


if(f.line1.value=="" )
{
document.getElementById('adddispid').innerHTML="Please enter your address";
  clearErrorMessage('adddispid');
f.line1.select();
return false;
}
if(!line.match(line_str))
   {
     document.getElementById('adddispid').innerHTML="Address not acceptable! Please use characters ranging from (a-z) (A-Z)  (0-9) (.,-/#) and it should start with a character."; 
	  clearErrorMessage('adddispid');
   f.line1.select();
     return false;    
   }

if(line.length>200)
{
document.getElementById('adddispid').innerHTML="Address not valid! Address should have atleast 6 characters and atmost 200 characters";
 clearErrorMessage('adddispid');
f.line1.select();
return false;
}
if(f.country.value=="") 
  {
    document.getElementById('coudispid').innerHTML="Please select your country";
	 clearErrorMessage('coudispid');
    f.country.focus();
    return false; 
  } 
  if(f.state.value=="") 
  {
    document.getElementById('stadispid').innerHTML="Please select your state";
	clearErrorMessage('stadispid');
    f.state.focus();
    return false; 
  } 
  var ct=f.city.value;
  var city_str=new RegExp("[a-z A-Z]+$","ig");

  if(ct=="")
	  {
    document.getElementById('citdispid').innerHTML="Please type your city name";
	clearErrorMessage('citdispid');
    f.city.focus();
    return false; 
  } 
  if(ct!="")
  {
  	var totalage_re=new RegExp("^[a-zA-Z][a-z A-Z ]+$","ig");
	if(!ct.match(totalage_re))
		{
			document.getElementById('citdispid').innerHTML="Please type Valid city name";
			clearErrorMessage('citdispid');
			 f.city.focus();
			 return false;
			
		}
	}
  
if(ct.length>30)
{
    document.getElementById('citdispid').innerHTML="City field can contain a maximum of 30 characters only";
	clearErrorMessage('citdispid');
    f.city.focus();
    return false; 
 } 
if(!ct.match(city_str))
	  {
    document.getElementById('citdispid').innerHTML="City not valid! Please use characters ranging from (a-z) (A-Z) only";
	clearErrorMessage('citdispid');
    f.city.focus();
    return false; 
  } 
  var pin_code=new RegExp("^[1-9][0-9]+$","ig");
 if(f.pin_code.value!="")
 {	
 	var val = 	f.pin_code.value;
	if(!val.match(pin_code))
	{
		document.getElementById('zipdispid').innerHTML="Please enter a valid Pincode";
		clearErrorMessage('zipdispid');
		f.pin_code.select();
		return false;
	}
}
if(f.residencysta[0].checked==false && f.residencysta[1].checked==false && f.residencysta[2].checked==false && f.residencysta[3].checked==false){
document.getElementById('resdispid').innerHTML="Please select Residency Status";
clearErrorMessage('resdispid');

return false;
}
if(f.terms_conditions.checked==false){
document.getElementById('terdispid').innerHTML="Please select Terms and conditions";
clearErrorMessage('terdispid');
f.terms_conditions.focus();
return false;
}
return true;
}






function state_value(chosen)
{
var f=document.form2.state;
f.options.length=0;
	if(chosen == ""){
		f.options[f.options.length]=new Option('Please Select a country',' ');
	}
	if(chosen == "India"){
	f.options[f.options.length]=new Option('SELECT A STATE','');
	f.options[f.options.length]=new Option('AndamanNicobar','AndamanNicobar');
	f.options[f.options.length]=new Option('AndhraPradesh','AndhraPradesh');
	f.options[f.options.length]=new Option('ArunachalaPradesh','ArunachalaPradesh');
    f.options[f.options.length]=new Option('Assam','Assam');
	f.options[f.options.length]=new Option('Bihar','Bihar');
	f.options[f.options.length]=new Option('Chandigarh','Chandigarh');
    f.options[f.options.length]=new Option('Chattisgarh','Chattisgarh');
	f.options[f.options.length]=new Option('Dadranagar&Haveli','Dadranagar&Haveli');
	f.options[f.options.length]=new Option('Daman&Diu','Daman&Diu');
    f.options[f.options.length]=new Option('Delhi','Delhi');
	f.options[f.options.length]=new Option('Goa','Goa');
	f.options[f.options.length]=new Option('Gujarath','Gujarath');
	f.options[f.options.length]=new Option('Haryana','Haryana');
	f.options[f.options.length]=new Option('HimachalPradesh','HimachalPradesh');
	f.options[f.options.length]=new Option('Jammu&Kashmir','Jammu&Kashmir');
    f.options[f.options.length]=new Option('Jharkhand','Jharkhand');
	f.options[f.options.length]=new Option('Karnataka','Karnataka');
	f.options[f.options.length]=new Option('Kerala','Kerala');
    f.options[f.options.length]=new Option('Lakshadweep','Lakshadweep');
	f.options[f.options.length]=new Option('MadhyaPradesh','MadhyaPradesh');
	f.options[f.options.length]=new Option('Maharashtra','Maharashtra');
	f.options[f.options.length]=new Option('Manipur','Manipur');
	f.options[f.options.length]=new Option('Meghalaya','Meghalaya');
	f.options[f.options.length]=new Option('Mizoram','Mizoram');
	f.options[f.options.length]=new Option('Nagaland','Nagaland');
	f.options[f.options.length]=new Option('Orissa','Orissa');
	f.options[f.options.length]=new Option('Pondicherry','Pondicherry');
	f.options[f.options.length]=new Option('Punjab','Punjab');
	f.options[f.options.length]=new Option('Rajasthan','Rajasthan');
	f.options[f.options.length]=new Option('Sikkim','Sikkim');
	f.options[f.options.length]=new Option('Tamilnadu','Tamilnadu');
	f.options[f.options.length]=new Option('Tripura','Tripura');
	f.options[f.options.length]=new Option('UttarPradesh','UttarPradesh');
	f.options[f.options.length]=new Option('Uttaranchal','Uttaranchal');
	f.options[f.options.length]=new Option('West Bengal','West Bengal');		
	
}
else if(chosen == "Bangladesh"){
	f.options[f.options.length]=new Option('SELECT A STATE','');
	f.options[f.options.length]=new Option('Barisal','Barisal');
	f.options[f.options.length]=new Option('Chittagong','Chittagong');
	f.options[f.options.length]=new Option('Dhaka','Dhaka');
	f.options[f.options.length]=new Option('Khulna','Khulna');
	f.options[f.options.length]=new Option('Rajshahi','Rajshahi');
	f.options[f.options.length]=new Option('Sylhet','Sylhet');
}
else if(chosen != "") {
	f.options[f.options.length]=new Option('SELECT A STATE','');
	f.options[f.options.length]=new Option('OTHER','OTHER');
}
}


function nuberChecking(name1,x,dipId)
{	
	var totalage_re=new RegExp("^[0-9][0-9]+$","ig");
	if(x.length > 0)
	{	clearErrorMessage("");
		if(!x.match(totalage_re))
		{
			if(dipId=="1")
			{
			 document.getElementById('phodispid').innerHTML="Only Numbers are Allowed";
  			 clearErrorMessage('phodispid');
  			}
  			if(dipId=="2")
			{
			 document.getElementById('mobdispid').innerHTML="Only Numbers are Allowed";
  			 clearErrorMessage('mobdispid');
  			}
  			
			 name1.focus();
			 return false;
			
		}
	}
}


function clearErrorMessage(idvalue)
{
	if(idvalue=="refdispid")
	{}
	else
		document.getElementById('refdispid').innerHTML="";
	
	if(idvalue=="logdispid")
	{}
	else
		document.getElementById('logdispid').innerHTML="";
	
	if(idvalue=="pasdispid")
	{}
	else
		document.getElementById('pasdispid').innerHTML="";


	if(idvalue=="repdispid")
	{}
	else
		document.getElementById('repdispid').innerHTML="";
    if(idvalue=="selectdate")
	{}
	else
		document.getElementById('selectdate').innerHTML="";


	if(idvalue=="emadispid")
	{}
	else
		document.getElementById('emadispid').innerHTML="";
	
	if(idvalue=="cemdispid")
	{}
	else
		document.getElementById('cemdispid').innerHTML="";

	if(idvalue=="gendispid")
	{}
	else
		document.getElementById('gendispid').innerHTML="";
	
	if(idvalue=="saldispid")
	{}
	else
		document.getElementById('saldispid').innerHTML="";
		
	if(idvalue=="namdispid")
	{}
	else
		document.getElementById('namdispid').innerHTML="";
		
	if(idvalue=="detdispid")
	{}
	else
		document.getElementById('detdispid').innerHTML="";
	
	if(idvalue=="phodispid")
	{}
	else
		document.getElementById('phodispid').innerHTML="";
	
	if(idvalue=="mobdispid")
	{}
	else
		document.getElementById('mobdispid').innerHTML="";
		
	if(idvalue=="adddispid")
	{}
	else
		document.getElementById('adddispid').innerHTML="";
	
	if(idvalue=="coudispid")
	{}
	else
		document.getElementById('coudispid').innerHTML="";
	
	if(idvalue=="stadispid")
	{}
	else
		document.getElementById('stadispid').innerHTML="";
	
	if(idvalue=="citdispid")
	{}
	else
		document.getElementById('citdispid').innerHTML="";
	
	if(idvalue=="zipdispid")
	{}
	else
		document.getElementById('zipdispid').innerHTML="";
		
	if(idvalue=="resdispid")
	{}
	else
	document.getElementById('resdispid').innerHTML="";
	
	if(idvalue=="terdispid")
	{}
	else
		document.getElementById('terdispid').innerHTML="";
	
		
	
	
}






function jsPlay(soundobj) {
 var thissound= eval("document."+soundobj);
 try {
     thissound.Play();
 }
 catch (e) {
     thissound.DoPlay();
 }
}


function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


