$(document).ready(function(){
	
if ($.browser.msie && $.browser.version=="6.0") {

$('#why-list').change(function() {

if ($('#why-list').val() == 1) {
$('#product-list,#ordernumber').attr("disabled", false);  
}

else {
$('#product-list,#ordernumber').attr("disabled", true);}

});

}

else{

$('#contact-support').fadeTo(650, .8);
$('#contact-support h4').fadeTo(650, .6);

$('#why-list').change(function() {

if ($('#why-list').val() == 1) {
$('#contact-support, #contact-support h4').fadeTo(350, 1.0);
$('#product-list,#ordernumber').attr("disabled", false);  
}

else {
$('#contact-support').fadeTo(650, .8);
$('#contact-support h4').fadeTo(650, .6);
$('#product-list,#ordernumber').attr("disabled", true);}

});

}

});

function validate_required(field,alerttxt){
with (field){
if (value==null||value=="")
{alert(alerttxt);return false;}
else {return true}
}

}

function validate_form(thisform){

with (thisform){
if (validate_required(name,"Seems you forgot to enter your name, go ahead and do that now.")==false)
{name.focus();return false;}

if (validate_required(email,"Seems you forgot to enter your email, go ahead and do that now.")==false)
{email.focus();return false;}

if(document.contact.list.selectedIndex==0)
{alert("Seems you forgot to tell us why you are contacting us, please do that now.")
list.focus();return false;}

if(document.contact.list.selectedIndex==1)
{if(document.contact.product.selectedIndex==0)
{alert("Seems you forgot to tell us which product you need support with, go ahead and do that now.")
product.focus();return false;}
if (validate_required(order,"Seems you forgot to enter your order number, go ahead and do that now.")==false)
{email.focus();return false;}
}

if(document.contact.list.selectedIndex==0)
{alert("Seems you forgot to tell us why you are contacting us, please do that now.")
list.focus();return false;}

if (validate_required(message,"Seems you forgot to enter your message, go ahead and do that now.")==false)
{message.focus();return false;}

with (email){
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
{alert("Your email is not valid, go ahead and fix it now.");return false;}
}
}

if (document.contact.email.value != document.contact.email2.value) {
alert ('The email addresses you entered do not match. Please go and fix them now.')
return false;
}

}
