// JavaScript Document

// mouseover
function smartRollover() {
	if(document.getElementsByTagName) {	
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("-d."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("-d.", "-x."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("-x.", "-d."));
				}
			}
		}		

		var images = document.getElementsByTagName("input");
		for(var i=0; i < images.length; i++) {
			if ( !images[i].getAttribute("src") ) { continue; }
			if(images[i].getAttribute("src").match("-d."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("-d.", "-x."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("-x.", "-d."));
				}
			}
		}		
	}
}
if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

// popup
function openWindow(theURL,winName,WW,WH,SCB) { //v2.0
  var Features = 'status=no,directories=no,menubar=no,resizable=no,toolbar=no,scrollbars=' + SCB + ',width=' + WW + ',height=' + WH;
  subWin_a = window.open(theURL,winName,Features);
  subWin_a.focus()
}

// popup-width,hight
function m_win(url,windowname,width,height) {
 var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no";
 if (width) {
  if (window.screen.width > width)
   features+=", left="+(window.screen.width-width)/2;
  else width=window.screen.width;
  features+=", width="+width;
 }
 if (height) {
  if (window.screen.height > height)
   features+=", top="+(window.screen.height-height)/2;
  else height=window.screen.height;
  features+=", height="+height;
 }
 window.open(url,windowname,features);
}

// close window
function WinC(){
    window.opener = window;
    var win = window.open(location.href,"_self");
    win.close();
}