


function randomInteger(size) {
   return Math.floor((size+1)*Math.random());
}
function RollOver(i) {
	if (document.images) {
		document.images[i].src = ImgOver[i].src;
	}
}

function RollOut(i) {
	if (document.images) {
	 	document.images[i].src = ImgOut[i].src;
	}
}

	
	
	
function checkZip() {
	zip  = document.form.zip.value;
	re = /^(\d{5})(-\d{4})?$/
		
	return re.test(zip);
}
	
function checkPhone(phone) { 
   re = /^(\(?\d{3}\)?\s*)\d{3}[\s-]?\d{4}$/
	return re.test(phone);
}
	
function checkState() {
	countryIndex = document.form.country.selectedIndex ;
	country = document.form.country.options[countryIndex].value;     
	
	if(country == "USA"){
		stateIndex = document.form.usaState.selectedIndex ;
		state = document.form.usaState.options[stateIndex].value;      
   
   	if (stateIndex == 0) {
   		return false;
   	}
   } else if (country == "MEX") {
   	stateIndex = document.form.mexState.selectedIndex ;
		state = document.form.mexState.options[stateIndex].value;      
			   
		if (stateIndex == 0) {
			return false;
   	}
   	
   }
   
   return true;
}

function checkCountry() {
	countryIndex = document.form.country.selectedIndex ;
	country = document.form.country.options[countryIndex].value;      
	
	if (countryIndex == 0) {
		return false;
	} 
	   
	return true;
}

var now = new Date();
var expdate = new Date(now.getTime() +5*24*60*60*1000);

function makeCookie(cookieName, nameValue) {
	document.cookie = cookieName +" = "+nameValue+";expires="+expdate.toGMTString();
		
}

function findCookie(cookieName) {
    var cookie = null;
    var findVal = cookieName + "=";
    var dc = document.cookie;
    if (dc.length > 0) {
        var start = dc.indexOf(findVal);
        if (start >= 0) {
            start += findVal.length;
            lastVal = dc.indexOf(";", start);
            if (lastVal == -1) {
                lastVal = dc.length;
            }
            cookie = dc.substring(start, lastVal);
        }
    }
    if(cookie == null) {
     cookie = "";
    }
    return cookie;
}
function delName(cookieName) {
	document.cookie = cookieName+"=;expires=Thu, 01-Jan-70 00:00:01 GMT;"
}

function otherCountry(){
	var otherCountry = document.form.otherCountry.value;
	if(otherCountry.length == 0){
		return false;
	}
	return true;
}
function getCountryName() {
	countryIndex = document.form.country.selectedIndex ;			
	countryName = document.form.country.options[countryIndex].value;      
	     
	return countryName;
}
function checkEmail(){
	email  = document.form.email.value;
	re = /^\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,8}$/
	return re.test(email);
}
	
function hideIt(object) {
				object=document.getElementById(object);
				object.style.display="none";
}
function showIt(object) {
	object=document.getElementById(object);
	object.style.display="inline";
}
