// JavaScript Document

//=====================================================================
//  DOM Image Rollover v3 (hover)
//
//  Demo: http://chrispoole.com/scripts/dom_image_rollover_hover
//  Script featured on: Dynamic Drive (http://www.dynamicdrive.com)
//=====================================================================
//  copyright Chris Poole
//  http://chrispoole.com
//  This software is licensed under the MIT License 
//  <http://opensource.org/licenses/mit-license.php>
//=====================================================================

function domRollover() {
	if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion <7) return;
	var imgarr=document.getElementsByTagName('img');
	var imgPreload=new Array();
	var imgSrc=new Array();
	var imgClass=new Array();
	for (i=0;i<imgarr.length;i++){
		if (imgarr[i].className.indexOf('domroll')!=-1){
			imgSrc[i]=imgarr[i].getAttribute('src');
			imgClass[i]=imgarr[i].className;
			imgPreload[i]=new Image();
			if (imgClass[i].match(/domroll (\S+)/)) {
				imgPreload[i].src = imgClass[i].match(/domroll (\S+)/)[1]
			}
			imgarr[i].setAttribute('xsrc', imgSrc[i]);
			imgarr[i].onmouseover=function(){
				this.setAttribute('src',this.className.match(/domroll (\S+)/)[1])
			}
			imgarr[i].onmouseout=function(){
				this.setAttribute('src',this.getAttribute('xsrc'))
			}
		}
	}
}
domRollover();

function CheckData(arg1){
  var error=true
  var theAlert="Please enter the required fields:"
  var fields=new Array("How did you hear about sample requests","First Name","Last Name","Company Name","Street Address","City","State","Zip","Country","Email_Address","Phone Number");
  var fields_name=new Array("How did you hear about sample requests","First Name","Last Name","Company Name","Street Address","City","State","Zip","Country","Email_Address","Phone Number");
   for(i=0;i<=7;i++){
		if(arg1.elements[fields[i]].value==""){
			 error=false
			 theAlert=theAlert+"\n"+fields_name[i]
								   }
								   }
									if(error!=true){
									alert(theAlert)
									return false
									}else{
									return true
									}
									alert(theAlert)
}


function CheckData2(arg1){
  var error=true
  var theAlert="Please enter the required fields:"
  var fields=new Array("Name","Company","Address1","City","State","Zip","Country","Email");
  var fields_name=new Array("Name","Company","Address1","City","State","Zip","Country","Email");
   for(i=0;i<=7;i++){
		if(arg1.elements[fields[i]].value==""){
			 error=false
			 theAlert=theAlert+"\n"+fields_name[i]
								   }
								   }
									if(error!=true){
									alert(theAlert)
									return false
									}else{
									return true
									}
									alert(theAlert)
}


function ResetItems(arg){
switch (arg.name) {
	case "medical": 
		document.forms[1].industrial.selectedIndex=0;
		document.forms[1].general.selectedIndex=0; 
	break;
	case "industrial": 
		document.forms[1].medical.selectedIndex=0;
		document.forms[1].general.selectedIndex=0; 
	break;
	case "general": 
		document.forms[1].industrial.selectedIndex=0;
		document.forms[1].medical.selectedIndex=0; 
	break;
	default: 
		document.forms[1].industrial.selectedIndex=0;
		document.forms[1].medical.selectedIndex=0;
		document.forms[1].general.selectedIndex=0;
	break;
}
}
