function getRadio(form) { 
	var state = form.select_state.options[form.select_state.selectedIndex].value;
	var url = 'radio_win.php?id=7&state='+state;
	if (state) {
		radioWin=window.open(url, "radioWin", "width=350,height=400,status=0,toolbar=0,menubar=0,scrollbars=1,resizable=1");
			if (!radioWin.opener) {
				radioWin.opener = window;
			}
		radioWin.focus();
	}
}



if (document.images) {
	rollovers = 1;
} else {
    rollovers = 0;
}
        
if (rollovers)
{

nav_home_ON = new Image(63,19);
nav_home_ON.src = "images/nav_home_ON.gif";
nav_home_OFF = new Image(63,19);
nav_home_OFF.src = "images/nav_home_OFF.gif";

}


function imgOn( imgName ) {
	if ( rollovers ) {
		document[imgName].src = eval( "nav_" + imgName + "_ON.src" );
	}
}

function imgOff( imgName ) {
	if ( rollovers ) {
		document[imgName].src = eval( "nav_" + imgName + "_OFF.src" );
	}
}



///////////////////// this section handles the open window stuff
var isOpen;
var newWin;

function viewImage(img,w,h,id) {
	var theURL='view.php?img='+img+'&h='+h+'&w='+w+'&img_id='+id;
	makeWin(theURL,w,h);	

}

function makeWin(URL,w,h) {
	w=w+100;
	h=h+100;
	newWin=window.open(URL, "newWin", "width="+w+",height="+h+",status=0,toolbar=0,menubar=0,scrollbars=0,resizable=1");
		if (!newWin.opener) {
			newWin.opener = window;
		}
	newWin.focus();
}


function checkWin() {
	if(newWin) newWin.close();
}
////////////////////////////////////////////////////////////////



function checkEmail(theForm) { 
	if (isEmpty(theForm.email.value)) {
		alert("Please enter your email address.");
		theForm.email.focus();
		theForm.email.select();
		return false
	}
	if ((theForm.email.value.indexOf("@") == -1) || (theForm.email.value.indexOf(".") == -1)) {
	 	theForm.email.focus();
		theForm.email.select();
		alert("Please enter a valid email address.");
		return false;
	}

}

function isEmpty(input) {
	if (input == "" || input == null) {
		return true
	}
	return false
}
	
function select(field) {
	field.focus()
	field.select()
}

function checkZip(element) {
	var digits="0123456789-";
	for (i = 0; i < element.value.length; i++) {
		c = element.value.charAt(i);
		if (digits.indexOf(c) == -1) {
			return false;
			break;
		}
	}
	return true;
}

function checkPhone(element) {
	var digits="0123456789-().";
	for (i = 0; i < element.value.length; i++) {
		c = element.value.charAt(i);
		if (digits.indexOf(c) == -1) {
			return false;
			break;
		} else {
			return true;
		}
	}
}

// function to format 2 digit decimal places
function format(expr,decplaces) {
	var str = ""+Math.round(eval(expr)*Math.pow(10,decplaces));
	while(str.length<=decplaces) {
		str = "0"+str;
	}
	var decpoint = str.length - decplaces;
	return str.substring(0,decpoint) + "." + str.substring(decpoint,str.length);
}

function dollarize(expr) {
	return "$"+format(expr,2);
}


var styleSheet="";
// this is for NS4
if((navigator.appName=="Netscape")&&(navigator.appVersion.charAt(0)=="4")) {
	styleSheet="stylesNS.css";
} else {
	styleSheet="stylesIE.css";
}

document.write('<link rel="stylesheet" type="text/css" href="'+styleSheet+'">');
