//open window
openwin = new Array() ;
function MM_openBrWindow(theURL,winName,features) { //v2.0
	own = winName ;
	openwin[own]=window.open(theURL,winName,features);
	openwin[own].focus();
}

//Rollover img change
function smartRollover() {
 if(document.getElementsByTagName) {
					
  var images = document.getElementsByTagName("img");
  for(var i=0; i < images.length; i++) {
   if(images[i].className.match("over"))
   {
    images[i].onmouseover = function() {
     this.setAttribute("src", this.getAttribute("src").replace(".gif", "_over.gif"));
     this.setAttribute("src", this.getAttribute("src").replace(".jpg", "_over.jpg"));
    }
    images[i].onmouseout = function() {
     this.setAttribute("src", this.getAttribute("src").replace("_over.gif", ".gif"));
     this.setAttribute("src", this.getAttribute("src").replace("_over.jpg", ".jpg"));
    }
   }
  }
 }
}

//inputAreaColor
function inputAreaColor() {
	var inputAreaID="SS_searchQuery";
	var inputStr="入力してください";
	var OnColor="#000000";
	var OffColor="#999999";
	var OnBgColor="#FFFFFF";
	var OffBgColor="#e1e1e1";
	if(document.getElementById(inputAreaID)) {
	 
		//initialize
		document.getElementById(inputAreaID).value=inputStr;
		document.getElementById(inputAreaID).style.color=OffColor;
		document.getElementById(inputAreaID).style.backgroundColor=OffBgColor;
		
		//onfocus
		document.getElementById(inputAreaID).onfocus =function() {
			if(this.value==inputStr){
				this.value='';
			}
			this.style.color=OnColor;
			this.style.backgroundColor=OnBgColor;
		}
		
		//onblur
		document.getElementById(inputAreaID).onblur =function() {
		this.style.backgroundColor=OnBgColor;
			if(this.value==''){
				this.value=inputStr;
				this.style.color=OffColor;
				this.style.backgroundColor=OffBgColor;
			}else{
				this.style.color=OnColor;
				this.style.backgroundColor=OnBgColor;
			}
		}
	}
}



function smartSelect(){
		if(document.getElementById("selectmenu")) {
			document.getElementById("selectmenu").style.width ='180px';
	}
}



if (window.addEventListener) {
window.addEventListener("load", smartRollover, false);
window.addEventListener("load", inputAreaColor, false);
window.addEventListener("load", smartSelect, false);
}
if (window.attachEvent) {
window.attachEvent("onload", smartRollover);
window.attachEvent("onload", inputAreaColor);
window.attachEvent("onload", smartSelect);
}



