document.write('<STYLE TYPE="text/css">.imgTrans{ filter:blendTrans(duration=0.0,transition=21) }</STYLE>');

var onImages=new Array();
function Rollover(imgName, imgSrc)
{
	onImages[imgName] = new Image();
	onImages[imgName].src = imgSrc;
}

function turnOn(imgName){ 
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].apply();
	document.images[imgName].offSrc = document.images[imgName].src;
	document.images[imgName].src    = onImages[imgName].src;
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].play();
}

function turnOff(imgName){ 
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].stop();
	document.images[imgName].src = document.images[imgName].offSrc;
}

var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}



//Specify name of participating images, plus paths to their onMouseover replacements:

Rollover("about",  "navs/about_on.jpg");
Rollover("gallery",  "navs/gallery_on.jpg");
Rollover("recipe",  "navs/recipe_on.jpg");
Rollover("clients",  "navs/clients_on.jpg");
Rollover("contact",  "navs/contact_on.jpg");


//Automate Copyright Year

today=new Date();
y0=today.getFullYear();


function pops(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=485,left = 337,top = 141.5');");
}



function pops1(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=530,height=465,left = 247,top = 151.5');");
}




function pops2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=525,left = 337,top = 121.5');");
}




function gallery(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=440,height=380,left = 292,top = 194');");
}



function gallery1(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=440,height=420,left = 292,top = 174');");
}





//VALIDATE CONTACT FORM

var empty = new Image(); empty.src = "fieldempty.gif";
var email = new Image(); email.src = "emailerror.gif";
var phone = new Image(); phone.src = "phoneerror.gif";

var haveerrors = 0;
function showImage(imagename, imageurl, errors) {
document[imagename].src = imageurl;
if (!haveerrors && errors) haveerrors = errors;
}

function validateForm(f) {
haveerrors = 0;
(f.Name.value.length < 1) // validate first name length
? showImage("firstnameerror", "fieldempty.gif", true)   // no semi-colon after this line!
: showImage("firstnameerror", "blankimage1.gif", false); // true = errors, false = no errors



(f.Company.value.length < 1) // validate first name length
? showImage("companyerror", "fieldempty.gif", true)   // no semi-colon after this line!
: showImage("companyerror", "blankimage1.gif", false); // true = errors, false = no errors

phonenumlength = f.area.value.length + 
f.exchange.value.length + f.number.value.length;

(phonenumlength != 10) // validate phone number length
? showImage("phoneerror", "fieldempty.gif", true)
: showImage("phoneerror", "blankimage1.gif", false);

(f.Email.value.search("@") == -1 || f.Email.value.search("[.*]") == -1) // validate email
? showImage("emailerror", "fieldempty.gif", true)
: showImage("emailerror", "blankimage1.gif", false);

return (!haveerrors);

}


function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
}
