
//.............. Show/Hide Notepad ..............\\

function showNotepad() {
  document.getElementById('notePad').style.visibility = "visible";
  if (ie) {
  	taHeightIE();
  } else {
	taHeight();
  }
}

function showNotepad_noURL() {
  document.getElementById('notePad-noURL').style.visibility = "visible";
  if (ie) {
  	taHeightIE();
  } else {
	taHeight();
  }
}

function hideNotepad() {
  document.getElementById('notePad').style.visibility = "hidden";
  if (ie) {
  	taHeightIE();
  } else {
	taHeight();
  }
}

function hideNotepad_noURL() {
  document.getElementById('notePad-noURL').style.visibility = "hidden";
  if (ie) {
  	taHeightIE();
  } else {
	taHeight();
  }
}




//.............. Validate Contact Page ..............\\

function validateContact() {
    var theMessage = "";
    var noErrors = theMessage;


    if ( document.emailContact.theirInput.value == "" ) {
	theMessage = document.getElementById('inputDiv').style.visibility = "visible";
	document.emailContact.theirInput.focus();
    } else {
	document.getElementById('inputDiv').style.visibility = "hidden";
    }

    if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.emailContact.theirEmail.value)) {
	theMessage = document.getElementById('emailEnterDiv').style.visibility = "visible";
    } else {
	document.getElementById('emailEnterDiv').style.visibility = "hidden";
    } 


   if (theMessage == noErrors) {
	return true;
   } else {
	theMessage;
	return false;
	}

   }






//.............. Text Focus/Blur For Contact Page ..............\\

var emailText=new Array('Enter your eMail','');
function checkInput() {
	if(document.emailContact.theirEmail.value==emailText[1]) {
	document.emailContact.theirEmail.value=emailText[0];
	}
}
function reInput() {
	if(document.emailContact.theirEmail.value==emailText[0]) {
	document.emailContact.theirEmail.value=emailText[1];
	}
}





//.............. Logo Click Thru ..............\\

function homePage() {
	location.href="index.html";
}



//.............. Image/Label Slideshow ..............\\

var ua,an,ie,win;
ua=navigator.userAgent;
an=navigator.appName;
ie=ua.indexOf('MSIE')>=0;
win=ua.indexOf('Windows')>=0;
ge=ua.indexOf('Gecko')>=0;
mac=ua.indexOf('Mac')>=0;

function fadeV2() {
  imageId = 'photoslider';
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
}



function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
}



var EXtimer;
var maxTime = 5000;
function EXsetTimer() {
	EXtimer = setTimeout("nextImg()", maxTime);
}

function taHeight() {
	document.rotater.description.style.height = "0px";
	document.rotater.description.style.height = document.rotater.description.scrollHeight+"px";
}


function taHeightIE() {
	//document.rotater.description.style.height = "0px";
	document.rotater.description.style.height = document.rotater.description.scrollHeight+"px";
}


function initImg() {
  if (i<img_rnd.length-1) {
	i++
	document.images.photoslider.src = img_rnd[i];
	document.rotater.description.value = label_rnd[i];
	taHeight();
  }
	else { 
		i=1;
		prevImg();
		return false;
	}
  EXsetTimer();
}



function prevImg() {
   if (document.all){
      document.images.photoslider.style.filter="blendTrans(duration=2)"
      document.images.photoslider.filters.blendTrans.Apply()      
   } 

   if (document.all){
        document.images.photoslider.filters.blendTrans.Play();
	taHeight();
   }  else { fadeV2(); }

  if (i>0) {
	i--
	document.images.photoslider.src = img_rnd[i];
	document.rotater.description.value = label_rnd[i];
	taHeight();
  }
  EXsetTimer();
}

function nextImg() {
   if (document.all){
        document.images.photoslider.style.filter="blendTrans(duration=2)"
        document.images.photoslider.filters.blendTrans.Apply()      
   } 

   if (document.all){
        document.images.photoslider.filters.blendTrans.Play();
	taHeight();
   } else { fadeV2(); }



  if (i<img_rnd.length-1) {
	i++
	document.images.photoslider.src = img_rnd[i];
	document.rotater.description.value = label_rnd[i];
	taHeight();
  }
	else { 
		i=1;
		prevImg();
		return false;
	}
  EXsetTimer();
}

