// NAVIGATION /////////////////////////////////////////////////

var Base="../images/interface_images/nav/";

if (document.images) {

    productsDIM = new Image();   productsDIM.src = Base + "productsDIM.gif";
    productsLIT = new Image();   productsLIT.src = Base + "productsLIT.gif";

    portfolioDIM = new Image();   portfolioDIM.src = Base + "portfolioDIM.gif";
    portfolioLIT = new Image();   portfolioLIT.src = Base + "portfolioLIT.gif";

	aboutDIM = new Image();   aboutDIM.src = Base + "aboutDIM.gif";
    aboutLIT = new Image();   aboutLIT.src = Base + "aboutLIT.gif";

    supportDIM = new Image();   supportDIM.src = Base + "supportDIM.gif";
    supportLIT = new Image();   supportLIT.src = Base + "supportLIT.gif";
               
    linksDIM = new Image();   linksDIM.src = Base + "linksDIM.gif";
    linksLIT = new Image();   linksLIT.src = Base + "linksLIT.gif";

    contactDIM = new Image();   contactDIM.src = Base + "contactDIM.gif";
    contactLIT = new Image();   contactLIT.src = Base + "contactLIT.gif";

    sitemapDIM = new Image();   sitemapDIM.src = Base + "sitemapDIM.gif";
    sitemapLIT = new Image();   sitemapLIT.src = Base + "sitemapLIT.gif";

	homeDIM = new Image();   homeDIM.src = Base + "homeDIM.gif";
    homeLIT = new Image();   homeLIT.src = Base + "homeLIT.gif";

    padDIM = new Image();   padDIM.src = Base + "btn_padDIM.gif";
    padLIT = new Image();   padLIT.src = Base + "btn_padLIT.gif";

    premierDIM = new Image();   premierDIM.src = Base + "btn_premierDIM.gif";
    premierLIT = new Image();   premierLIT.src = Base + "btn_premierLIT.gif";

    brunoDIM = new Image();   brunoDIM.src = Base + "btn_brunoDIM.gif";
    brunoLIT = new Image();   brunoLIT.src = Base + "btn_brunoLIT.gif";

	ultraDIM = new Image();   ultraDIM.src = Base + "btn_ultraDIM.gif";
    ultraLIT = new Image();   ultraLIT.src = Base + "btn_ultraLIT.gif";

    saharaDIM = new Image();   saharaDIM.src = Base + "btn_saharaDIM.gif";
    saharaLIT = new Image();   saharaLIT.src = Base + "btn_saharaLIT.gif";

}
                
function imgOn(imgName,target) {
	if (document.images) {
		document[target].src = eval(imgName + "LIT.src");       
	}
}
                
function imgOff(imgName,target) {
	if (document.images) {
		document[target].src = eval(imgName + "DIM.src");       
	}
}


// The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)
// See:  http://www.msc.cornell.edu/~houle/javascript/randomizer.html
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
         rnd.seed = (rnd.seed*9301+49297) % 233280;
         return rnd.seed/(233280.0);
};
function rand(number) {
         return Math.ceil(rnd()*number);
};
// end central randomizer. -->


// WINDOW CLOSE AND LOADER /////////////////////////////////////////////////
function supressError() {
        return true;
    }

    function load(url) {

        window.onerror = supressError;
        opener.location.href = url;
        setTimeout('self.close()',1000);
  	}



// WINDOW OPENER /////////////////////////////////////////////////

var myWindow = 'LinkWindow';

function win(fileName) {
        window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=yes,toolbar=yes,width=550,height=400,screenX=0,screenY=0,top=0,left=235')
}

var myWindow = 'LinkWindow';

function winVER(fileName) {
        window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=yes,toolbar=yes,width=400,height=500,screenX=0,screenY=0,top=0,left=235')
}


var myWindow = 'LinkWindow';

function winSML(fileName) {
        window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=yes,toolbar=yes,width=300,height=250,screenX=0,screenY=0,top=0,left=235')
}

var myWindow = 'LinkWindow';

function winLRG(fileName) {
        window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=yes,toolbar=yes,width=800,height=600,screenX=0,screenY=0,top=0,left=235')
}
var myWindow = 'LinkWindow';

function winSWATCH(fileName) {
        window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=440,height=480,screenX=0,screenY=0,top=0,left=0')
}

var myWindow = 'Enlargement'
function winEnlargement(pid,category) {
        window.open('../enlargement.php?productid=' + pid + '&category=' + category,myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=740,height=620,screenX=0,screenY=0,top=0,left=235')
}

var myWindow = 'Enlargement'
function winPortfolioEnlargement(pid) {
        window.open('enlargement.php?productid=' + pid,myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=740,height=620,screenX=0,screenY=0,top=0,left=235')
}

var myWindow = 'Enlargement'
function winRandomThumbEnlargement(pid) {
        window.open('../randomEnlargement.php?productid=' + pid,myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=740,height=620,screenX=0,screenY=0,top=0,left=235')
}
// DATE ///////////////////////////////////////////////////////////
	var today=new Date();
	
	function nameDay() {
	  var arg1=nameDay.arguments;
	  for (var i=0; i < arg1.length; i++) {
	    this[i]=arg1[i];
	  }
	  this.length=arg1.length;
	}
	
	function nameMonth() {
	  var arg2=nameMonth.arguments;
	  for (var i=0; i < arg2.length; i++) {
	    this[i]=arg2[i];
	  }
	  this.length=arg2.length;
	}

	function getString(date) {
	  var day=new nameDay("Sunday", "Monday", "Tuesday","Wednesday", "Thursday", "Friday","Saturday");
	  var month=new nameMonth("January","February","March","April","May","June","July","August","September","October","November","December");
	  var yy = date.getYear();
	  var year = (yy < 1000) ? yy + 1900 : yy;
	  
	  return day[date.getDay()] + ", " + month[date.getMonth()] + " " + date.getDate() + ", " + year;
	}
	
	function printDate(){	
		var display=getString(today);
		document.write(display);
	}


   function validateContactForm() {
    if (document.contactForm.who.value=="Please Select") {
    	alert('You must fill in the Who are you field before submitting');
    	document.contactForm.who.focus();
    	return false;
    }
    if (document.contactForm.name.value=="") {
    	alert('You must fill in the Name field before submitting');
    	document.contactForm.name.focus();
    	return false;
    }
    if (document.contactForm.companyname.value=="") {
    	alert('You must fill in the Company Name field before submitting');
    	document.contactForm.companyname.focus();
    	return false;
    }
    if (document.contactForm.address.value=="") {
    	alert('You must fill in the Address field before submitting');
    	document.contactForm.address.focus();
    	return false;
    }
    if (document.contactForm.city.value=="") {
    	alert('You must fill in the City field before submitting');
    	document.contactForm.city.focus();
    	return false;
    }
    if (document.contactForm.state.value=="") {
    	alert('You must fill in the State field before submitting');
    	document.contactForm.state.focus();
    	return false;
    }
    if (document.contactForm.zip.value=="") {
    	alert('You must fill in the Zip Code field before submitting');
    	document.contactForm.zip.focus();
    	return false;
    }
    if (document.contactForm.country.value=="") {
    	alert('You must fill in the Country field before submitting');
    	document.contactForm.country.focus();
    	return false;
    }
    if (document.contactForm.email.value=="") {
    	alert('You must fill in the email field before submitting');
    	document.contactForm.email.focus();
    	return false;
    }
    if (document.contactForm.email.value.indexOf("@",0)==-1) {
    	alert('You have entered an invalid email address.  Please fix before submitting');
    	document.contactForm.email.focus();
    	return false;
    }
    if (document.contactForm.phone.value=="") {
    	alert('You must fill in the Telephone field before submitting');
    	document.contactForm.phone.focus();
    	return false;
    }
	if (document.contactForm.projectName.value=="") {
    	alert('You must fill in the Project Name field before submitting');
    	document.contactForm.projectName.focus();
    	return false;
    }
	if (document.contactForm.projectCity.value=="") {
    	alert('You must fill in the Project City field before submitting');
    	document.contactForm.projectCity.focus();
    	return false;
    }
	if (document.contactForm.projectState.value=="") {
    	alert('You must select the Project State before submitting');
    	document.contactForm.projectState.focus();
    	return false;
    }
   }    
