/* HOMEPAGE SLIDESHOW START */

function reapply(){
setTimeout("slideit()",2000)
return true
}
window.onerror=reapply

var image1=new Image()
image1.src="pic_moveit.gif"
var image2=new Image()
image2.src="pic_hangit.gif"
var image3=new Image()
image3.src="pic_rackit.gif"
var image4=new Image()
image4.src="pic_stackit.gif"
//-->

////change number of images below 
var number_of_images=4
//change speed below (in seconds)
var speed=2
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
if (document.all)
slide.filters.blendTrans.apply()
document.images.slide.src=eval("image"+step+".src")
if (document.all)
slide.filters.blendTrans.play()
whichimage=step
if (step<number_of_images)
step++
else
step=1
if (document.all)
setTimeout("slideit()",speed*1000+3000)
else
setTimeout("slideit()",speed*1000)
}
function slidelink(){
if (whichimage==1)
window.location="applications_computerrooms.htm"
else if (whichimage==2)
window.location="applications_industrial.htm"
else if (whichimage==3)
window.location="applications_outdoor.htm"
else if (whichimage==4)
window.location="applications_offices.htm"
}

/* HOMEPAGE SLIDESHOW END */




function selectText(){
document.TheForm.TheText.focus();
document.TheForm.TheText.select();
}













/* OLD HOMEPAGE SLIDESHOW */
/* define image width and height */

var pic_width=245;
var pic_height=240;

/* define image urls */

if (document.images)
 {
     pic1= new Image(pic_width,pic_height);
     pic1.src="pic_computerrooms_anim.gif";  
     pic2= new Image(pic_width,pic_height); 
     pic2.src="pic_industrial_anim.gif"; 
     pic3= new Image(pic_width,pic_height);
     pic3.src="pic_events_anim.gif";  
     pic4= new Image(pic_width,pic_height);
     pic4.src="pic_offices_anim.gif";  
     pic5= new Image(pic_width,pic_height);
     pic5.src="pic_healthcare_anim.gif";  
     pic6= new Image(pic_width,pic_height);
     pic6.src="pic_mobile_anim.gif";  
 }    

/* define text for image captions  */

var pics= new Array(6) 
   pics[0]=pic1.src;
   pics[1]=pic2.src;
   pics[2]=pic3.src;
   pics[3]=pic4.src;
   pics[4]=pic5.src;
   pics[4]=pic6.src;

var numpics=6;
var thenum=0;
imgName="img1";



var myimages=new Array()

function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
//Enter path of images to be preloaded inside parenthesis. Extend list as desired.
preloadimages("bg.jpg")



function gotosite(site) {
  if (site != "") {
  self.location=site
  } 
}

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable,toolbar=no'
win = window.open(mypage, myname, winprops)
/* if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } */
}

function popup_null() {
}


function Validate_warranty(theform) {
// Verify that required data exists prior
// to submitting review to server.

   	// MUST ENTER COMPANY
	if (theform.company.value.length == 0) {
		alert( "Please enter Company");
		theform.company.focus();
		return false
	}

   	// MUST ENTER CONTACT
	if (theform.contact.value.length == 0) {
		alert( "Please enter Contact");
		theform.contact.focus();
		return false
	}

   	// MUST ENTER TITLE
	if (theform.title.value.length == 0) {
		alert( "Please enter Title");
		theform.title.focus();
		return false
	}

   	// MUST ENTER STREET
	if (theform.street.value.length == 0) {
		alert( "Please enter Street");
		theform.street.focus();
		return false
	}

   	// MUST ENTER CITY
	if (theform.city.value.length == 0) {
		alert( "Please enter City");
		theform.city.focus();
		return false
	}

   	// MUST ENTER STATE
	if (theform.state.value.length == 0) {
		alert( "Please enter State");
		theform.state.focus();
		return false
	}

   	// MUST ENTER ZIP
	if (theform.zip.value.length == 0) {
		alert( "Please enter Zip Code");
		theform.zip.focus();
		return false
	}

   	// MUST ENTER PHONE
	if (theform.phone.value.length == 0) {
		alert( "Please enter Phone Number");
		theform.phone.focus();
		return false
	}

   	// MUST ENTER YOUR E-MAIL
	if (theform.email.value.length == 0) {
		alert( "Please enter E-mail Address");
		theform.email.focus();
		return false
	}

    // CHECK EMAIL FORMAT
    var input_str=theform.email.value;
    var input_len1=input_str.length;
    var iserror=0;
    input_len1=input_str.length;
    var lastdot=-1;
    var lastat=-1;
    var numberat=0;

    if (theform.email.value.length != 0) {

        for (var j = 0; j < input_len1; j++) {
             var ch2 = input_str.substring(j, j + 1);
             if (((ch2 < "a") ||  (ch2 > "z")) && ((ch2 < "A") || (ch2 > "Z")) && ((ch2 < "0") ||  (ch2 > "9")) && (ch2 != "@" ) && (ch2 != ".") && (ch2 != "_") && (ch2 != "-")){
                 alert("Please input a valid email address!\nValid characters include A-Z, a-z, 0-9, -, _, . and @");
                 iserror=1;
             }
             if (ch2==".") {
                 if ( j == lastdot + 1) {
                     alert("Please input a valid email address!\nYou can't have two dots next to\neach other'..'.");
                     iserror=1;
                 }
                 lastdot=j;
             }
             if (ch2=="@") {
                 lastat=j;
                 numberat=numberat+1
             }
             if (ch2==" ") {
                 alert("Please input a valid email address!\nYou can't have any spaces in the address.");
                 iserror=1;
             }
        }
        if (lastat == -1) {
             alert("Please input a valid email address!\nYou don't have an '@'.");
             iserror=1;
        }
        if (lastat == 0) {
             alert("Please input a valid email address!\nYou don't have a name before the '@'.");
             iserror=1;
        }
        if (numberat > 1) {
             alert("Please input a valid email address!\nYou may have only one '@'.");
             iserror=1;
        }
        if ((lastdot <= lastat) || (lastdot > input_len1 - 3 ) || (input_len1 - lastdot > 4)) {
             alert("Please input a valid email address!\nYou don't have a proper domain name!\nUse .com, .org, .net, .us, etc");
             iserror=1;
        }
        if (lastdot == lastat + 1) {
             alert("Please input a valid email address!\nYou don't have a proper organization name!\nUse name@organization.domain");
             iserror=1;
        }
        if (iserror==1) {
             theform.email.focus();
             return false;
        }

    }

   	// MUST ENTER PURCHASE DATE
	if (theform.purchase_date.value.length == 0) {
		alert( "Please enter Purchase Date");
		theform.purchase_date.focus();
		return false
	}

   	// MUST ENTER SERIAL NUMBER
	if (theform.serial_number.value.length == 0) {
		alert( "Please enter Serial Number");
		theform.serial_number.focus();
		return false
	}

   	// MUST ENTER DEALER NAME
	if (theform.dealer_name.value.length == 0) {
		alert( "Please enter Dealer Name");
		theform.dealer_name.focus();
		return false
	}

   	// MUST ENTER DEALER LOCATION
	if (theform.dealer_location.value.length == 0) {
		alert( "Please enter Dealer Location");
		theform.dealer_location.focus();
		return false
	}

   	// MUST SELECT BUSINESS TYPE
    if (theform.business_type[0].selected == true) {
        alert("Please select your type of business");
        return false
    }

   	// MUST SELECT HEAR ABOUT
    if (theform.hear_about[0].selected == true) {
        alert("Please indicate how you heard about CoolCube 10");
        return false
    }

   	// MUST CHECK AT LEAST ONE FACTOR
	if ((theform.factor_pq.checked == false) && (theform.factor_price.checked == false) && (theform.factor_portability.checked == false) && (theform.factor_rack.checked == false) && (theform.factor_stacking.checked == false) && (theform.factor_ease.checked == false) && (theform.factor_energy.checked == false) && (theform.factor_versatility.checked == false)) {
        alert("Please indicate which factor (or factors) most influenced your decision to purchase a CoolCube 10");
        return false
    }

    // MUST SELECT PREVIOUS PURCHASE
   	// prev_purchase
    if ((theform.prev_purchase[0].checked == false) && (theform.prev_purchase[1].checked == false)) {
        alert("Please indicate whether you have previously purchased a CoolCube 10 unit");
        return false
    }

    // IF PREVIOUS PURCHASE IS YES, MUST ENTER HOW MANY
   	// how_many
    if ((theform.prev_purchase[0].checked == true) && (theform.how_many.value.length == 0)) {
        alert("Please indicate how many CoolCube 10 units you have purchased");
        theform.how_many.focus();
        return false
    }

    // MUST SELECT WHERE UNIT USED
   	// where_used
    if (theform.where_used[0].selected == true) {
        alert("Please indicate where the unit is used");
        return false
    }

    // MUST SELECT PRIMARY USE
   	// primary_use
    if (theform.primary_use[0].selected == true) {
        alert("Please indicate the primary use for this unit");
        return false
    }

    return true
}

