// JavaScript Document
/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;

// popup

function winOpen(url,w,h) {
  var winFig;
  var width = parseInt(w);
  var height = parseInt(h);

  st = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrolbars=no,resizable=no,";
  winFig = window.open("", "OpenWin", st+"width="+width+",height="+height);

  winFig.document.open();
  winFig.document.writeln("<html>");
  winFig.document.writeln("<head><title>image window</title></head>");
  winFig.document.writeln('<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">');
  winFig.document.writeln('<a href="javascript:void(0);" onClick="self.window.close()"><img src="'+url+'" border="0" /></a>');
  winFig.document.writeln("</body>");
  winFig.document.writeln("</html>");
  winFig.document.close();

  var Win   = navigator.userAgent.indexOf("Win") != -1   ? true : false;
  var Mac   = navigator.userAgent.indexOf("Mac") != -1   ? true : false;

  if(Win) {
    if(navigator.userAgent.indexOf("Gecko")!=-1){
      winFig.location.reload();
    }
  }
}

// target blank

function pageJump(obj){
	if (document.form1.check1.checked) {
		obj.target = "_blank";
	} else {
		obj.target = "_self";
	}
}

// unyu

function showMore(varA1, varB1){
	varRVS = ('varR' + (varA1));
	varMORE = ('varM' + (varA1));
	if( document.getElementById ) {
		if( document.getElementById(varRVS).style.display ) {
			if( varB1 != 0 ) {
				document.getElementById(varRVS).style.display = 'block';
				document.getElementById(varMORE).style.display = 'none';
			} else {
				document.getElementById(varRVS).style.display = 'none';
				document.getElementById(varMORE).style.display = 'block';
			}
		} else {
			location.href = varB1;
			return true;
		}
	} else {
		location.href = varB1;
		return true;
	}
}

