// JavaScript Document

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

	// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;

// Duration of crossfade (seconds)
var crossFadeDuration = 3;

// Specify the image files
var Pic = new Array(); // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = '../images/look.jpg';
Pic[1] = '../images/quote.jpg';
Pic[2] = '../images/home-loan.jpg';
Pic[3] = '../images/guarantee.jpg';


// =======================================
// do not edit anything below this line
// =======================================

var t;
 var j = 0;
var p = Pic.length;

var preLoad = new Array();
for (i = 0; i < p; i++){
   preLoad[i] = new Image();
   preLoad[i].src = Pic[i];
}


function runSlideShow(){
	
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();     
   }
   
   document.images.SlideShow.src = preLoad[j].src;
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
  
   j = j + 1;
   if (j > (p-1)) j=0;
   t = setTimeout('runSlideShow()', slideShowSpeed);
}

function runSlideShow2() {
	j = j + 2;
	if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();     
   }
   document.images.SlideShow.src = preLoad[j].src;
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
   j = j + 1;
   if (j > (p-1)) j=0;
   t = setTimeout('runSlideShow()', slideShowSpeed);
}

function tenantSlideShow() {
	if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();     
   }
   document.images.SlideShow.src = preLoad[j].src;
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
   j = j + 1;
   if (j > (p-1)) j=0;
   t = setTimeout('runSlideShow()', slideShowSpeed);
}

function buttonOver(thisButton) {
	thisButton.className = "submit_hover";
}

function buttonOut(thisButton) {
	thisButton.className = "submit";
}

function button2Over(thisButton) {
	thisButton.className = "button_hover";
}

function button2Out(thisButton) {
	thisButton.className = "button";
}

function removeOver(thisButton) {
	thisButton.className = "remove_hover";
}

function removeOut(thisButton) {
	thisButton.className = "remove";
}

function emptyValidation(entered){
	// Emptyfield Validation by Henrik Petersen / NetKontoret
	// Explained at www.echoecho.com/jsforms.htm
	// Please do not remove this line and the two lines above.
	with (entered){
		if (value==null || value==""){
			alert("The following field is required: " + entered.name);
			//alert(msg);
			return false;
		} else {return true;}
	}
}

function validateContractorQuestionnaire(thisForm) {
	with(thisForm){
		
		if (emptyValidation(contractor_name)==false){
			contractor_name.focus();
			return false;
		}
		if (emptyValidation(job) == false) {
			job.focus();
			return false;
		}
		if (emptyValidation(address) == false) {
			address.focus();
			return false;
		}
		return true;
	}
}

function validateIPMQuestionnaire(thisForm) {
	with (thisForm) {
		if (emptyValidation(tenant_name) == false) {
			tenant_name.focus();
			return false;
		}
		if (emptyValidation(address) == false) {
			address.focus();
			return false;
		}
		return true;	
	}
}

function validateSubscribe(thisForm) {
	with (thisForm) {
		if (emptyValidation(name) == false) {
			name.focus();
			return false;
		}
		if (emptyValidation(address) == false) {
			address.focus();
			return false;
		}
		if (emptyValidation(email) == false) {
			email.focus();
			return false;
		}
	}
	return true;
}
	




