

	// This is where you preload your images

		contact1          = new Image (127,33);
        contact1.src      = "http://www.offthefront-marketing.com/images/btn_contact_blue.gif";

        contact2          = new Image (127,33);
        contact2.src      = "http://www.offthefront-marketing.com/images/btn_contact_white-up.gif";

		contact3          = new Image (127,33);
        contact3.src      = "http://www.offthefront-marketing.com/images/btn_contact_white-down.gif";

		logo1          = new Image (160,120);
        logo1.src      = "http://www.offthefront-marketing.com/images/logo.gif";
		
		logo2          = new Image (160,120);
        logo2.src      = "http://www.offthefront-marketing.com/images/wheel-anim.gif";
		
		services1          = new Image (140,45);
        services1.src      = "http://www.offthefront-marketing.com/images/nav-btn-services-off.gif";
		
		services2          = new Image (140,45);
        services2.src      = "http://www.offthefront-marketing.com/images/nav-btn-services-on.gif";
		
		services3          = new Image (140,45);
        services3.src      = "http://www.offthefront-marketing.com/images/nav-btn-services-dn.gif";

		clients1          = new Image (140,45);
        clients1.src      = "http://www.offthefront-marketing.com/images/nav-btn-clients-off.gif";
		
		clients2          = new Image (140,45);
        clients2.src      = "http://www.offthefront-marketing.com/images/nav-btn-clients-on.gif";
		
		clients3          = new Image (140,45);
        clients3.src      = "http://www.offthefront-marketing.com/images/nav-btn-clients-dn.gif";

		aboutus1          = new Image (140,45);
        aboutus1.src      = "http://www.offthefront-marketing.com/images/nav-btn-aboutus-off.gif";
		
		aboutus2          = new Image (140,45);
        aboutus2.src      = "http://www.offthefront-marketing.com/images/nav-btn-aboutus-on.gif";
		
		aboutus3          = new Image (140,45);
        aboutus3.src      = "http://www.offthefront-marketing.com/images/nav-btn-aboutus-dn.gif";

// this function swaps the images

function swapImage(oldButton,newButton){
	document.images[oldButton].src=eval(newButton + ".src");
}	


// this function autotabs through field after max length reached

function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
}

//pre processing check for required fields

function checkrequired(which){
var pass=true
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]
if (tempobj.name.substring(0,8)=="required"){
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
pass=false
break
}
}
}
}
if (!pass){
alert("One or more of the required elements are not completed. Please complete them, then submit again!")
return false
}
else
return true
}

//

var testresults
function checkemail(){
var str=document.contactus.requiredemail.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address!")
testresults=false
}
return (testresults)
}

// 

function checkbae(){
if (document.layers||document.getElementById||document.all)
return checkemail()
else
return true
}

// this clears text boxeson focus

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

//
function validate(text1,text2,text3,text4)
{
 if (text1==text2 && text3==text4)
 load('./failure.html');
 else 
 {
  load('./failure.html');
 }
}
function load(url)
{
 location.href=url;
}

// 
