function disable(){
	if(document.whistling_wood.country.value=="Others"){
	document.whistling_wood.othercountry.disabled=false;

	}
	else 	document.whistling_wood.othercountry.disabled=true; 
}


function show_val(){
	if(document.whistling_wood.country.value == 'Australia' ){
	document.whistling_wood.optional.value = 61;
	document.whistling_wood.std.value = 61;
	document.whistling_wood.optional.setAttribute('readonly',true); 
	document.whistling_wood.std.setAttribute('readonly',true); 
	}
	else if(document.whistling_wood.country.value == 'Canada' ){
	document.whistling_wood.optional.value = 1;
	document.whistling_wood.std.value = 1;
	document.whistling_wood.optional.setAttribute('readonly',true); 
	document.whistling_wood.std.setAttribute('readonly',true); 
	}
	else if(document.whistling_wood.country.value == 'France' ){
	document.whistling_wood.optional.value = 33;
	document.whistling_wood.std.value = 33;
	document.whistling_wood.optional.setAttribute('readonly',true); 
	document.whistling_wood.std.setAttribute('readonly',true); 
	}
	else if(document.whistling_wood.country.value == 'Germany' ){
	document.whistling_wood.optional.value = 49;
	document.whistling_wood.std.value = 49;
	document.whistling_wood.optional.setAttribute('readonly',true); 
	document.whistling_wood.std.setAttribute('readonly',true); 
	}
	else if(document.whistling_wood.country.value == 'India' ){
	document.whistling_wood.optional.value = 91;
	document.whistling_wood.std.value = 91;
	document.whistling_wood.optional.setAttribute('readonly',true); 
	document.whistling_wood.std.setAttribute('readonly',true); 
	}
	else if(document.whistling_wood.country.value == 'Ireland' ){
	document.whistling_wood.optional.value = 353;
	document.whistling_wood.std.value = 353;
	document.whistling_wood.optional.setAttribute('readonly',true); 
	document.whistling_wood.std.setAttribute('readonly',true); 
	}
	else if(document.whistling_wood.country.value == 'Spain' ){
	document.whistling_wood.optional.value = 34;
	document.whistling_wood.std.value = 34;
	document.whistling_wood.optional.setAttribute('readonly',true); 
	document.whistling_wood.std.setAttribute('readonly',true); 
	}
	else if(document.whistling_wood.country.value == 'UK' ){
	document.whistling_wood.optional.value = 44;
	document.whistling_wood.std.value = 44;
	document.whistling_wood.optional.setAttribute('readonly',true); 
	document.whistling_wood.std.setAttribute('readonly',true); 
	}
	else if(document.whistling_wood.country.value == 'USA' ){
	document.whistling_wood.optional.value = 1;
	document.whistling_wood.std.value = 1;
	document.whistling_wood.optional.setAttribute('readonly',true); 
	document.whistling_wood.std.setAttribute('readonly',true); 
	}
	else if(document.whistling_wood.country.value == 'Others' ){
	document.whistling_wood.optional.value = "";
	document.whistling_wood.std.value = "";
	document.whistling_wood.optional.removeAttribute('readonly',true); 
	document.whistling_wood.std.removeAttribute('readonly',true); 
	}
	else{
	document.whistling_wood.optional.value = '';
	document.whistling_wood.std.value = '';
	document.whistling_wood.optional.setAttribute('readonly',true); 
	document.whistling_wood.std.setAttribute('readonly',true); 
	}

}

function submitform(Form)
{
	var tel=document.whistling_wood.phone.value;

	 var mob=document.whistling_wood.mobile.value.charAt(0);
    var mob1=document.whistling_wood.mobile.value.charAt(1);


if((Form.first_name.value=="")||(Form.first_name.value=="Full Name")) {
alert("Kindly fill in your  Name!");
Form.first_name.focus();
return false;
}
else if(containsdigit(Form.first_name.value))
{
alert("First Name Contains numeric!");
Form.first_name.focus();
return false;
}
else if(containswrong(Form.first_name.value))
{
alert("First Name Contains junk!");
Form.first_name.focus();
return false;
}


else if((Form.last_name.value=="")||(Form.last_name.value=="Full Name")) {
alert("Kindly fill in your  Last Name!");
Form.last_name.focus();
return false;
}
else if(containsdigit(Form.last_name.value))
{
alert("Last Name Contains numeric!");
Form.last_name.focus();
return false;
}
else if(containswrong(Form.last_name.value))
{
alert("Last Name Contains junk!");
Form.last_name.focus();
return false;
}

else if(Form.email.value==""){
alert("Kindly fill in your email!");
Form.email.focus();
return false;
} 
else if((Form.email.value!='') && (validateemailv2(Form.email.value)==false)){
alert("Enter Valid Email ID!");
Form.email.focus();
return false;
}
else if(Form.country.value=="-1"){
alert("Kindly select your country!");
Form.country.focus();
return false;
}
else if(Form.country.selectedIndex==0){
alert("Kindly select your country!");
Form.country.focus();
return false;
}

else if((Form.std.value=="")||(Form.std.value=="Std code")) {
alert("Please provide your country code!");
Form.std.focus();
Form.std.select();
return false;
} else if((containsalpha(Form.std.value))||(containswrong(Form.std.value))) {
alert("country code Contains Alpha/junk!");
Form.std.focus();
Form.std.select();
return false;
}
else if((Form.std1.value=="")||(Form.std1.value=="Std code")) {
alert("Please provide your Area code!");
Form.std1.focus();
Form.std1.select();
return false;
} else if((containsalpha(Form.std1.value))||(containswrong(Form.std1.value))) {
alert("Area code Contains Alpha/junk!");
Form.std1.focus();
Form.std1.select();
return false;
}
 else if((Form.phone.value=="")||(Form.phone.value=="Phone No")) {
alert("Kindly fill in your Residence Telephone number!");
Form.phone.focus();
Form.phone.select();
return false;
} else if((containsalpha(Form.phone.value))||(containswrong(Form.phone.value))) {
alert("Please check your Residence Telephone number!");
Form.phone.focus();
Form.phone.select();
return false;
} else if((Form.phone.value.length<6)) {
alert("Please check your Residence Telephone !");
Form.phone.focus();
Form.phone.select();
return false;
}
else if((Form.optional.value=="")||(Form.optional.value=="code")) {
alert("Kindly fill in your mobile code!");
Form.optional.focus();
Form.optional.select();
return false;
}
else if((containsalpha(Form.optional.value))||(containswrong(Form.optional.value))) {
alert("Please check your mobile code!");
Form.optional.focus();
Form.optional.select();
return false;
}
else if((Form.mobile.value == "") || (Form.mobile.value == "Mobile No."))
{
alert("Please Enter Your Mobile Number");
Form.mobile.focus();
Form.mobile.select();
return false;
}	
else if(Form.mobile.value.length<6)
{
alert("Phone Enter a Valid Phone Number ");
Form.mobile.focus();
Form.mobile.select();
return false;
}

else if((containsalpha(Form.mobile.value))||(containswrong(Form.mobile.value)))
{
alert("Please check your Mobile number!");
Form.mobile.focus();
return false;
}
else if(Form.state.value==""){
alert("Please provide your State Name!");
Form.state.focus();
return false;
}

else if(Form.city.value==""){
alert("Please provide your City Name!");
Form.city.focus();
return false;
}
else {
Form.submit();
}

}

function containsalpha(param){
strLen = param.length;

for(i=0;i<strLen;i++)
{
if((param.charAt(i)<"0") || (param.charAt(i)>"9"))
{
return true;
}
}
return false;

} // end of containsalpha


function containsdigit(param){
strLen = param.length;

for(i=0;i<strLen;i++)
{
if((param.charAt(i)=="0") || (param.charAt(i)=="1") || (param.charAt(i)=="2") || (param.charAt(i)=="3") || (param.charAt(i)=="4") || (param.charAt(i)=="5") || (param.charAt(i)=="6") || (param.charAt(i)=="7") || (param.charAt(i)=="8") || (param.charAt(i)=="9"))
{
return true;
}
}
return false;

} // end of function containsdigit

function containswrong(param){
strLen1 = param.length;

for(i=0;i<strLen1;i++)
{
if((param.charAt(i)==";") || (param.charAt(i)=="=") || (param.charAt(i)=="+") || (param.charAt(i)=="*") || (param.charAt(i)=="#") || (param.charAt(i)=="$") || (param.charAt(i)=="%") || (param.charAt(i)=="^") || (param.charAt(i)=="?") || (param.charAt(i)=="@")||(param.charAt(i)=="/") || (param.charAt(i)=="<") || (param.charAt(i)==">")|| (param.charAt(i)=="-") || (param.charAt(i)=="~"))
{
return true;
}
}
return false;
}



function validateemailv2(email){
var splitted = email.match("^(.+)@(.+)$");
if(splitted == null) return false;
if(splitted[1] != null )
{
var regexp_user=/^\"?[\w-_\.]*\"?$/;
if(splitted[1].match(regexp_user) == null) return false;
}
if(splitted[2] != null)
{
var regexp_domain=/^[\w-\.]*\.[a-za-z]{2,4}$/;
if(splitted[2].match(regexp_domain) == null)
{
var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
if(splitted[2].match(regexp_ip) == null) return false;
}
return true;
}
return false;
} 

