function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
 
  var isMac = false;
  var agt = navigator.userAgent.toLowerCase();

  if (agt.indexOf("mac") != -1)
   isMac = true;

  if(!isMac)
     window.open(theURL,winName,features);
  else
     window.open(theURL,winName,'width=360,height=432,scrollbars=no');
}

function getDate() {
 
		now = new Date();
		day = new Object();
		month = new Object();
		day[0] = "Sunday";
		day[1] = "Monday";
		day[2] = "Tuesday";
		day[3] = "Wednesday";
		day[4] = "Thursday";
		day[5] = "Friday";
		day[6] = "Saturday";
		month[0] = "January";
		month[1] = "February";
		month[2] = "March";
		month[3] = "April";
		month[4] = "May";
		month[5] = "June";
		month[6] = "July";
		month[7] = "August";
		month[8] = "September";
		month[9] = "October";
		month[10] = "November";
		month[11] = "December";
		year = (now.getYear());
		if (year < 1000) year += 1900
		
		return (day[now.getDay()] + " " + month[now.getMonth()] + " " + 	now.getDate() + ", " + year);
}

function getYear() {
 
		now = new Date();
		
		year = (now.getYear());
		if (year < 1000) year += 1900
		
		return (year);
}

function checkform ( form )
{   
  var error = "";
  // ** START **
  if (form.name.value == "") {
    error += "Please enter in your name.\n"       
  }
  if (form.email.value == "") {        
    error += "Please enter your email address.\n";    
  }
  if (form.comments.value == "") {
    error += "Please enter in your comments or questions.\n"        
  }  
  
  if(error.length > 0) {
     alert(error);
     return false ;
  }   
  // ** END **
  return true ;
}

var logo = 0;
var maxLogo = 13;

function nextLogo(){
   if (logo + 1 > maxLogo)
     logo = 0;
   else
     logo++;
   swap();
}

function previousLogo(){
   if (logo - 1 < 0)
     logo = maxLogo;
   else
     logo--;
   swap();
}

function logoPosition(){
   return logo;
}

function swap() {
   document['logo'].src = "./images/logo/" + logoPosition() + ".jpg";
}


var card = 0;
var maxCard = 1;

function nextCard(){
   if (card + 1 > maxCard)
     card = 0;
   else
     card++;
   swapCard();
}

function previousCard(){
   if (card - 1 < 0)
     card = maxCard;
   else
     card--;
   swapCard();
}

function cardPosition(){
   return card;
}

function swapCard() {
   document['cards'].src = "./images/cards/" + cardPosition() + ".jpg";
}

var site = 0;
var maxSite = 6;

function nextSite(){
   if (site + 1 > maxSite)
     site = 0;
   else
     site++;
   swapSite();
}

function previousSite(){
   if (site - 1 < 0)
     site = maxSite;
   else
     site--;
   swapSite();
}

function sitePosition(){
   return site;
}

function swapSite() {	 
   document['sites'].src = "./images/sites/" + sitePosition() + ".jpg";  
}


