// JavaScript Document
var curLink = 1;
//setImage();

function setImage(){
//	document.getElementById('sub_but1').src = "images/companyLinks/companyLink1_roll.jpg";
//	var allDiv = sub_but1.getElementsByTagName("div");
//	document.getElementById("rollOverContent").innerHTML = allDiv[0].innerHTML;
}
function rollMeInner(img_name, img_src){
	document.getElementById(img_name).src = "images/companyLinks/companyLink"+img_src+"_roll.jpg";
}
function rollMeOutInner(img_name, img_src){
	document.getElementById(img_name).src = "images/companyLinks/companyLink"+img_src+".jpg";
}

function rollMe(img_name, img_src){
	if(curLink != img_src){
		document.getElementById(img_name).src = "images/companyLinks/companyLink"+img_src+"_roll.jpg";
	}
}
function rollMeOut(img_name, img_src){
    //document.getElementById("rollOverContent").innerHTML = "";
	if(curLink != img_src){
		document.getElementById(img_name).src = "images/companyLinks/companyLink"+img_src+".jpg";
	}
}
function rollClick(obj,img_name, img_src){
	resetAllImage();
	curLink = img_src;
	document.getElementById(img_name).src = "images/companyLinks/companyLink"+img_src+"_roll.jpg";
	var allDiv = obj.getElementsByTagName("div");
	document.getElementById("rollOverContent").innerHTML = allDiv[0].innerHTML;
}
function resetAllImage(){
	document.getElementById('sub_but1').src = "images/companyLinks/companyLink1.jpg";
	document.getElementById('sub_but2').src = "images/companyLinks/companyLink2.jpg";
	document.getElementById('sub_but3').src = "images/companyLinks/companyLink3.jpg";
	document.getElementById('sub_but4').src = "images/companyLinks/companyLink4.jpg";
	document.getElementById('sub_but5').src = "images/companyLinks/companyLink5.jpg";
	document.getElementById('sub_but6').src = "images/companyLinks/companyLink6.jpg";
	document.getElementById('sub_but7').src = "images/companyLinks/companyLink7.jpg";	
}

function chkFocus(curFocus){
	if(curFocus==1){
		document.getElementById('email').value="";
	}else{
		if(document.getElementById('email').value==""){
			document.getElementById('email').value=" E-mail";
		}
	}
}

function validate_form (){
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var address = document.certificate.email.value;
	if(reg.test(address) == false) {
	  alert('Invalid Email Address');
	}else{
	   document.certificate.submit();
	}
}

function sCity(x){
	if (document.getElementById('jumpCity').value != "null") {
		document.getElementById("iframe1").src = x;
	}
}
function sCompany(x){
	if (document.getElementById('jumpCompany').value != "null") {
		document.location.href = x;
	}
}
