
function rollovers() {
  /** string added to "on" state images */
  var post = "_on";

  /** fetch the image tag array from the DOM */
  var imgTags = document.getElementsByTagName("img");

  /** loop through the images for find appropriate preloads */
  for (i=0; i < imgTags.length; i++) {
    /** make sure there is a source defined */
    if (imgTags[i].src != '') {
      /** make sure the image tag has a class */
      tmpClass = imgTags[i].className;
      if (tmpClass) {
        /** match the image rollover class */    
        if (tmpClass.match("rollover")) {
          /** store the image source to the 'imgOut' attribute */        
          imgTags[i].imgOut = new Image();
          imgTags[i].imgOut.src = imgTags[i].src;
	
          /** pull apart the source string */
          srcLength = imgTags[i].src.length;

          srcName = imgTags[i].src.substr(0, srcLength-4);
          srcExt = imgTags[i].src.substr(srcLength-4, srcLength);

          /** store the image source to the 'imgOver' attribute */
          imgTags[i].imgOver = new Image();
          imgTags[i].imgOver.src = srcName + post + srcExt;

          /** set up the 'onmouseover' and 'onmouseout' event handlers */          
          imgTags[i].onmouseover = function() {
            this.src = this.imgOver.src;
          }
          imgTags[i].onmouseout = function() {
            this.src = this.imgOut.src;
          }
        }
      }
    }
  }
}

function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	if (imageType == "swf"){
	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); 	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function Lvl_openWin(u,n,w,h,l,t,c,f) { //v2.2 4LevelWebs
  var x=((screen.width-w)/2);if(c==1){l=x;t=(screen.height-h)/2;}if(c==2){l=x}
	f+=',top='+t+',left='+l;LvlWin=window.open(u,n,f);LvlWin.focus();
}

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 == '');
}

//<![CDATA[

function makearray(n) {
	this.length = n;
	for(var i = 1; i <= n; i++)
		this[i] = 0;
	return this;
}
function hex(i) {
	if (i < 0)	  return "00";
	else if (i > 255) return "ff";
	else		  return "" + hexa[Math.floor(i/16)] + hexa[i%16];
}
function hexnumtodec(hexchar) {
	if (parseInt(hexchar) == hexchar) return Number(hexchar)
	hexchar = hexchar.toUpperCase()
	switch (hexchar) {
		case 'A': return 10; break;
		case 'B': return 11; break;
		case 'C': return 12; break;
		case 'D': return 13; break;
		case 'E': return 14; break;
		case 'F': return 15; break;
	}
}
function hextodec(daHex) {
	var daDec = Number((16 * hexnumtodec(daHex.substring(0,1))) + hexnumtodec(daHex.substring(1,2)))
	return daDec
}

function setColor(r,g,b) {
	var hr = hex(r); var hg = hex(g); var hb = hex(b);
	var daColor = "#"+hr+hg+hb
	daEl.style.backgroundColor = daColor
	if (daColor == colorend.toLowerCase()) {
		clearInterval(iId)
		iId = null
		timerRunning = false
	}
}

function fade() {
	i++
	setColor(
		Math.floor(sr * ((step-i)/step) + er * (i/step)),
		Math.floor(sg * ((step-i)/step) + eg * (i/step)),
		Math.floor(sb * ((step-i)/step) + eb * (i/step)));
}
hexa = new makearray(16);
for(var i = 0; i < 10; i++)
	hexa[i] = i;
hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
hexa[13]="d"; hexa[14]="e"; hexa[15]="f";

var i
var iId = null
var sr, sg, sb
var er, eg, eb
var interval = 1
var step = 16
var colorstart
var colorend
var daEl
var timerRunning = false

function myfade(el,cs,ce,iv,st) {
	daEl = el
	colorstart = cs
	colorend = ce
	interval = iv
	step = st
	i = 0
	if (timerRunning) {
		clearInterval(iId)
		iId = null
	}
	var myRe = /#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i
	if (colorstart.match(myRe)) {
		sr = hextodec(RegExp.$1)
		sg = hextodec(RegExp.$2)
		sb = hextodec(RegExp.$3)
	}
	if (colorend.match(myRe)) {
		er = hextodec(RegExp.$1)
		eg = hextodec(RegExp.$2)
		eb = hextodec(RegExp.$3)
	}
	timerRunning = false;
	iId = setInterval("fade()",interval)
	timerRunning = true;
}
function cellover(table_cell) {
	// element, from_color, to_color, interval(milliseconds), transition steps
	myfade(table_cell,'#ffffff','#cccccc',15,32)
}
function cellout(table_cell) {
	if (timerRunning) {
		clearInterval(iId)
		iId = null
	}
	table_cell.style.backgroundColor = '#ffffff'
}
//]]>
