/* HOMEPAGE SLIDESHOW START */

function reapply(){
setTimeout("slideit()",5000)
return true
}
window.onerror=reapply

var image1=new Image()
image1.src="pic_5162.gif"
var image2=new Image()
image2.src="pic_5151.gif"
var image3=new Image()
image3.src="pic_maroonbells.gif"
var image4=new Image()
image4.src="pic_skyline.gif"
var image5=new Image()
image5.src="pic_creek.gif"
//-->

////change number of images below 
var number_of_images=5
//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="#top"
else if (whichimage==2)
window.location="#top"
else if (whichimage==3)
window.location="#top"
else if (whichimage==4)
window.location="#top"
else if (whichimage==5)
window.location="#top"
}

/* HOMEPAGE SLIDESHOW END */


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=yes'
win = window.open(mypage, myname, winprops)
/* if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } */
}

function popup_null() {
}

function checkString()
	{

	if (location.search) { 
	faq = location.search;

	for (i=0; i<=document.faqform.faq.length-1; i++) 
		{
		temp = document.faqform.faq.options[i].value;
		if (temp == location.search) {
		document.faqform.faq.selectedIndex = i;
		messageReveal();
alert("Your question has been selected for you automatically and the answer is being displayed in the bottom box.  ;-)");
window.location = window.location + "#faq";

         	}   
		}
	}
}



function MM_showHideLayers() { //v2.0
  var i, visStr, args, theObj;
  args = MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) { //with arg triples (objNS,objIE,visStr)
    visStr   = args[i+2];
    if (navigator.appName == 'Netscape' && document.layers != null) {
      theObj = eval(args[i]);
      if (theObj) 

{
theObj.pageY=74;
theObj.visibility = visStr;
}
    } else if (document.all != null) { //IE
      if (visStr == 'show') visStr = 'visible'; //convert vals
      if (visStr == 'hide') visStr = 'hidden';
      theObj = eval(args[i+1]);
      if (theObj) theObj.style.visibility = visStr;
  } }
}

function MM_swapImgRestore() { //v2.0
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

function MM_preloadImages() { //v2.0
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}

function MM_swapImage() { //v2.0
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore
}




function ValidateForm(theform) {
// Verify that required data exists prior
// to submitting review to server.

   	// MUST ENTER COMPANY
	if (theform.company.value.length == 0) {
		alert( "Please enter your Company");
		theform.company.focus();
		return false
	}

   	// MUST ENTER NAME
	if (theform.name.value.length == 0) {
		alert( "Please enter your Name");
		theform.name.focus();
		return false
	}

   	// MUST ENTER PHONE
	if (theform.phone.value.length == 0) {
		alert( "Please enter your Phone");
		theform.phone.focus();
		return false
	}

   	// MUST ENTER EMAIL
	if (theform.email.value.length == 0) {
		alert( "Please enter your 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 SELECT AMOUNT
    if ((theform.amount[0].checked == false) && 
        (theform.amount[1].checked == false) &&
        (theform.amount[2].checked == false) &&
        (theform.amount[3].checked == false) &&
        (theform.amount[4].checked == false)) {
        alert("Please enter a quantity of vouchers to purchase");
        return false;
    }

	// IF OTHER AMOUNT SELECTED, MUST SPECIFY AMOUNT
    if ((theform.amount[4].checked == true) && 
        (theform.amount_other.value.length == 0)) {
        alert("Please specify a quantity of vouchers to purchase");
		theform.amount_other.focus();
        return false;
    }

	// MUST SELECT CC TYPE
    if (theform.cc_type[0].selected == true) {
        alert("Please select Credit Card Type");
        return false;
    }

   	// MUST ENTER CC NUMBER
	if (theform.cc_number.value.length == 0) {
		alert( "Please enter your Credit Card Number");
		theform.cc_number.focus();
		return false
	}

	// MUST SELECT CC EXPIRATION MONTH
    if (theform.cc_exp_month[0].selected == true) {
        alert("Please select Expiration Date Month");
        return false;
    }

	// MUST SELECT CC EXPIRATION YEAR
    if (theform.cc_exp_year[0].selected == true) {
        alert("Please select Expiration Date Year");
        return false;
    }

   	// MUST ENTER CC NAME PRINTED ON CARD
	if (theform.name_card.value.length == 0) {
		alert( "Please enter the Name printed on card");
		theform.name_card.focus();
		return false;
	}

   	return true;
}

function ValidateZip( theform )
{
	if ( theform.Recordset13_Zip.value == null || theform.Recordset13_Zip.value == "" ) 
	{    
		alert("You must enter a valid zipcode.");
		theform.Recordset13_Zip.focus();
		return false;
    }
    
    return true;
}

function ValidateZip_sp( theform )
{
	if ( theform.Recordset13_Zip.value == null || theform.Recordset13_Zip.value == "" ) 
	{    
		alert("Usted debe incorporar un zipcode válido.");
		theform.Recordset13_Zip.focus();
		return false;
    }
    
    return true;
}
