//OS,ブラウザ判別
var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
var Win = navigator.appVersion.indexOf('Win',0) != -1;
var IE = navigator.userAgent.indexOf("MSIE",0) != -1;
var IE4x = navigator.userAgent.indexOf("MSIE 4",0) != -1;
var NS  = navigator.userAgent.indexOf("Netscape",0) != -1;
var NS4x =!IE && navigator.userAgent.indexOf("Mozilla/4",0) != -1;
var Opera = navigator.userAgent.indexOf("Opera",0) != -1;
var FF = navigator.userAgent.indexOf("Firefox",0) != -1;
var Moz = navigator.userAgent.indexOf("Gecko") != -1;
var safari = navigator.userAgent.indexOf("Safari") != -1;

function setACSLG(_a1,_a2){
	s.pageName = _a1;
	//s.channel="";
	void(s.t());
}

//popup window
function popupWindow (url, id, w, h, features, centering) {
	if(safari){
		h = h+1;
	}
	var s = (w ? ("width=" + w) : "") + (h ? (",height=" + h) : "");
	var ss = new Array ("menubar", "toolbar", "location", "scrollbars", "status", "resizable");
	if (features){
		for (i in ss){
			s += "," + ss [i] + "=" + features.charAt (i);
		}
	}
	if (centering) { var x = (screen.width / 2) - (w / 2 + 10);
	var y = (screen.height / 2) - (h / 2 + 10); s += ",left=" + x + ",top=" + y + ",screenX=" + x + ",screenY=" + y; }
	var o = window.open (url, id, s);
	o.focus ();
	return o;
}

//windowの開閉をcheck
function windowClosed (o) {
	return(!window.opener||window.opener.closed);
}

//window close
function windowClose () {
	var a = arguments;
	var r = true;
	if (a.length) 
	for (var i = 0; i < a.length; i++) { 
	var o = a [i]; 
	if (o) o.close (); 
	else r = false;
	} 
	else top.close (); return r; 
}

//親windowを遷移
function changeOpener (url) { 
	if (windowClosed (window.opener)) {
		popupWindow (url,"parent");
	}else{
		window.opener.location.href = url;
		window.opener.focus();
	}
}

//windowサイズを指定サイズに変更
//operaはpopupwindowのみ変更可能
function resizeToWIN(width,height,winName){
	if(!arguments[2])winName=self
    winName.resizeTo(width,height)
    if(window.opera||document.layers){       //n4 o6用
    	var w = winName.innerWidth  
    	var h = winName.innerHeight  
    } else if(document.all){                 //e用
    	var w = winName.document.body.clientWidth 
    	var h = winName.document.body.clientHeight
    } else if(document.getElementById){      //n6,n7,m1用
    	var w = winName.innerWidth   
    	var h = winName.innerHeight 
    }
    //resizeToの誤差を修正
    if(width!=w||height!=h){
    	winName.resizeBy((width-w),(height-h))
    	if(document.layers)
			winName.location.reload(0) //n4はreloadでresizeバグ回避 
    }
    winName.focus()
}