
function resetSearch(f){
	if(f.value=="商品・ショップ名で検索"){ f.value = "" ; }
}
function setSearch(f){
	if(f.value==""){ f.value = "商品・ショップ名で検索" ; }
}

function openWin(file,name,x,y) {
	window.open(file, name, "width="+x+",height="+y+",left=50,top=50, scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no");
}

function openWin2(file,name,x,y) {
	window.open(file, name, "width="+x+",height="+y+",left=50,top=50, scrollbars=yes,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no");
}

function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
		
		var images = document.getElementsByTagName("input");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("type")=="image" && images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}else if(images[i].getAttribute("type")=="text"){
				images[i].setAttribute("class", "mColor");
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

function navi(obj) {
 url = obj.options[obj.selectedIndex].value;
 if(url != "") {
   location.href = url;
  }
}


function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function PrintPage(){
	if(document.getElementById || document.layers){
		window.print();		//印刷をします
	}
}

/**
* windowを開く
* @param:
* tar:ターゲット<a>オブジェクト
* win:ウインドウ名
* o:オプションオブジェクト
* o.width:ウインドウ幅 [デフィルト:スクリーン幅 / 2]
* o.height:ウインドウ高 [デフィルト:スクリーン高 / 2]
* o.xpos:x座標 [デフィルト:0]
* o.ypos:y座標 [デフィルト:0]
* o.menu:メニューバーの有無 [デフィルト:no]
* o.tool:ツールバーの有無 [デフィルト:no]
* o.loc:ロケーションバーの有無 [デフィルト:no]
* o.status:ステータスバーの有無 [デフィルト:no]
* o.resize:リサイズの有無 [デフィルト:yes]
* o.scroll:スクロールバーの有無 [デフィルト:yes]
*/
function openWin(tar, win, o){
	var wo;
	var op="";
	var u = tar.href;
	var w = (win) ? win : "ARICAsub";
	if(o){
		o.width = (typeof o.width == 'undefined') ? screen.width/2 : o.width;
		o.height = (typeof o.height == 'undefined') ? screen.height/2 : o.height;
		o.xpos = (typeof o.xpos == 'undefined') ? (screen.width/2)-(o.width/2) : o.xpos;
		o.ypos = (typeof o.ypos == 'undefined') ? (screen.height/2)-(o.height/2) : o.ypos;
		o.menu = (typeof o.menu == 'undefined') ? 'no' : o.menu;
		o.tool = (typeof o.tool == 'undefined') ? 'no' : o.tool;
		o.loc = (typeof o.loc == 'undefined') ? 'no' : o.loc;
		o.status = (typeof o.status == 'undefined') ? 'no' : o.status;
		o.resize = (typeof o.resize == 'undefined') ? 'yes' : o.resize;
		o.scroll = (typeof o.scroll == 'undefined') ? 'yes' : o.scroll;
		
		o.xpos = (o.xpos == "left") ? o.xpos=0 : (o.xpos == "right") ? screen.width - o.width : o.xpos;
		o.ypos = (o.ypos == "top") ? o.ypos=0 : (o.ypos == "bottom") ? screen.height - o.height : o.ypos;
		
		
		op += 'menubar='+o.menu+",";
		op += 'toolbar=' + o.tool + ",";
		op += 'location=' + o.loc + ",";
		op += 'status=' + o.status + ",";
		op += 'resizable=' + o.resize + ","
		op += 'scrollbars=' + o.scroll + ",";
		op += 'width=' + o.width + ',height=' + o.height + ",";
		op += 'top=' + o.ypos + ',left=' + o.xpos;
	}
	
	wo = (op.length > 0) ? window.open(u,w,op) : window.open(u,w);
	wo.focus();
	return false;
}

