
function SwapBGColor(item, color) {
        item.style.backgroundColor = color;
    }
	
function openMap(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function imgOn (imgName) {
	if ( document.images ) {
		document[imgName].src = eval(imgName + "on.src");
		window.status = "";
	}
}

function imgOff (imgName) {
	if ( document.images ) {
		document[imgName].src = eval(imgName + "off.src");
	}
}	


//FUNCTIONS FOR DROP DOWN MENU

var ver = parseInt(navigator.appVersion);
var ns5 = ((navigator.appName.indexOf("Netscape") != -1) && (ver >= 5));
var ns4 = ((navigator.appName.indexOf("Netscape") != -1) && (ver >= 4));
var ie3 = ((navigator.appName.indexOf("Microsoft") != -1) && (ver < 4));
var ie4 = ((navigator.appName.indexOf("Microsoft") != -1) && (ver >= 4));


if ((navigator.appName.indexOf("Microsoft") != -1) && (!document.images))
{
	ie3 = true;
}


var startMenu

var ticker

function loader()
{
	startMenu = "1";
	if ((navigator.appName.indexOf("Microsoft") != -1) && (ver >= 4))
	{
		ticker = document.all("tickerDiv");
	} else if ((navigator.appName.indexOf("Netscape") != -1) && (ver >= 5))
	{
		ticker = document.getElementById("tickerDiv");
		
	}
		
	if (ticker != null)
	{
		tickerTimer = setTimeout("tick()", 1000);
	}
	else 
	{
		setTimeout("loader()", 5000);
	}

}

var isNS5 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5);
var isNS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
var isNS408 = (navigator.appName == "Netscape" && parseFloat(navigator.appVersion) <= 4.08);



function resizer() {
		if (isNS) {
				if (isNS408) {
				// do nothing
				} else {
				location.reload(true);
				}
		}
}


var toHide = "hide2";

function showList(channel) {
			if(ns5){
				
				hideList(toHide);
				
				document.getElementById(channel).style.visibility='visible';
				
				toHide = channel;
			} else if (!ns5){ 
				if (document.readyState == 'complete') {
				
												hideList(toHide);
				
												eval("document.all." + channel + ".style.visibility='visible'");
				
												toHide = channel;
												}        
			
		}               
}

function hideList(toHide) {
				if(isNS5){
				
				document.getElementById(toHide).style.visibility='hidden';
	
				} else  if (!isNS5){  
					if (document.readyState == 'complete') {
					
					eval("document.all." + toHide + ".style.visibility='hidden'");
				}
        }
}

function showNetList(object) {
        if (isNS) {
			if (startMenu == '1') {
				object.visibility = 'visible';
			}
        }     
}

function hideNetList(object) {
        if (isNS) {
			if (startMenu == '1') {
		        object.visibility = 'hidden';
			}
        }
}

function openNewWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function checkEmail() {
		
	var formObj = document.forms['frmContact'];
	var Email = document.frmContact.sEmail;		
	if (Email.value == '') {
		alert("Please enter your email!");
		Email.focus();		
	}
	else
	{	
		// test if valid email address, must have @ and .
		var checkEmail = "@.";
		var checkStr = Email.value;
		var EmailValid = false;
		var EmailAt = false;
		var EmailPeriod = false;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkEmail.length;  j++)
			{
				if (ch == checkEmail.charAt(j) && ch == "@")
				EmailAt = true;
				if (ch == checkEmail.charAt(j) && ch == ".")
				EmailPeriod = true;
			  	if (EmailAt && EmailPeriod)
					break;
			  	if (j == checkEmail.length)
					break;
			}
			// if both the @ and . were in the string
			if (EmailAt && EmailPeriod)
			{
				EmailValid = true
				break;
				
			}
			
		}
		if (!EmailValid)
		{
			alert("The email field must contain an \"@\" and a \".\".");
			Email.focus();
		}
		else
		{
			formObj.submit();
		}
	
	}
	
	
}


function ValidatePhone(m){
p=m.value
if(p.length==3){
        pp=p;
        d4=p.indexOf('(')
        d5=p.indexOf(')')
        if(d4==-1){
                pp="("+pp;
        }
        if(d5==-1){
                pp=pp+")";
        }
        m.value="";
        m.value=pp;
}
if(p.length>3){
        d1=p.indexOf('(')
        d2=p.indexOf(')')
        if (d2==-1){
                l30=p.length;
                p30=p.substring(0,4);
                p30=p30+")"
                p31=p.substring(4,l30);
                pp=p30+p31;
                m.value="";
                m.value=pp;
        }
}
if(p.length>5){
        p11=p.substring(d1+1,d2);
        if(p11.length>3){
             p12=p11;
             l12=p12.length;
             l15=p.length
             p13=p11.substring(0,3);
             p14=p11.substring(3,l12);
             p15=p.substring(d2+1,l15);
             m.value="";
             pp="("+p13+")"+p14+p15;
             m.value=pp;
        }
        l16=p.length;
        p16=p.substring(d2+1,l16);
        l17=p16.length;
        if(l17>3&&p16.indexOf('-')==-1){
                p17=p.substring(d2+1,d2+4);
                p18=p.substring(d2+4,l16);
                p19=p.substring(0,d2+1);
        pp=p19+p17+"-"+p18;
        m.value="";
        m.value=pp;
        }
}

}

function testphone(obj1){
         p=obj1.value
         p=p.replace("(","")
         p=p.replace(")","")
         p=p.replace("-","")
         p=p.replace("-","")
         if (isNaN(p)==true){
                  alert("Check phone");
                  return false;
         }
}

function showMeLogo()
{
	self.name = 'opener';
	remote = open('displaylogo.asp', 'remote', 'width=350,height=180,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no,fullscreen=no');
	remote.focus();
}	

function showMePhoto()
{
	self.name = 'opener';
	remote = open('displayphoto.asp', 'remote', 'width=350,height=180,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no,fullscreen=no');
	remote.focus();
}	

function setLetter() {
	document.frmContact.LetterCompanyName.value = document.frmContact.sCompanyName.value;	
	document.frmContact.LetterAddress.value = document.frmContact.sAddress.value;
	document.frmContact.LetterCity.value = document.frmContact.sCity.value;
	document.frmContact.LetterState.value = document.frmContact.sState.value;
	document.frmContact.LetterZip.value = document.frmContact.sZip.value;
	document.frmContact.LetterEmail.value = document.frmContact.sEmail.value;
	document.frmContact.LetterPhone.value = document.frmContact.sPhone.value;
	document.frmContact.LetterFax.value = document.frmContact.sFax.value;
}
