/* <![CDATA[ */
var FloaterImages=new Array();
function PreloadFloaters() {
	if(FloaterImages.length>0){
		for (i=0;i<FloaterImages.length;i++) {
			preload=new Image(177,340); 
			preload.src="http://"+location.host+"/images/"+FloaterImages[i]; 
		}
		RunFloaters(0,1);	
	}
}
RunFloaters = function(element,type) {
	if (type==1) {
		var myRandomNumber=Math.floor(Math.random()*4);
		document.getElementById('floaters').className='position-' + myRandomNumber;
		document.getElementById("floaters").innerHTML='<img src="/images/'+FloaterImages[element]+'" alt="" />';	
		new Effect.Appear('floaters');
		window.setTimeout('RunFloaters('+element+',2)',2000);
	}
	if (type==2) {
		new Effect.Fade('floaters');
		if(element==FloaterImages.length-1){
			element = 0;
		} else {	
			element=element+1;
		}	
		window.setTimeout('RunFloaters('+element+',1)',1000);
	}
}
function toggleDiv(divid){
  if(document.getElementById(divid).style.display == 'none'){
    document.getElementById(divid).style.display = 'inline';
  }else{
    document.getElementById(divid).style.display = 'none';
  }
}
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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
sfHover = function() {
	var sfEls = document.getElementById("navlist").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.addEventListener) { 
	//DOM method for binding an event
	window.addEventListener("load", PreloadFloaters, false);
} else if (window.attachEvent) { 
	//IE exclusive method for binding an event
	window.attachEvent("onload", sfHover);
	window.attachEvent("onload", PreloadFloaters);
} else if (document.getElementById) {
	//support older modern browsers
	window.onload=PreloadFloaters;
}


function sendEmail(encodedEmail) { location.href = 'mailto:' + decodeEmail('67696C65734073746461766964732D69742E636F2E756B'); }

// return the decoded email address
function decodeEmail(encodedEmail) {
    // The encodedEmail is a string that contains the email address.
    // Each character in the email address has been converted into 
    // a two digit number (hex / base16). This function converts the
    // series of numbers back into the real email address.

    // holds the decoded email address
    var email = "";

    // go through and decode the email address
    for (i = 0; i < encodedEmail.length; ) {
        // holds each letter (2 digits)
        var letter = "";
        letter = encodedEmail.charAt(i) + encodedEmail.charAt(i + 1)

        // build the real email address
        email += String.fromCharCode(parseInt(letter, 16));
        i += 2;
    }

    return email;
}

/* ]]> */