﻿//scripted by +39/tozaki 20/03/2007
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;

//openContents
function openContents (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;
}
//shift parent location
var pCat = "";
var outerLink = "http://www.mitsuifudosan.co.jp/redirect/toyosu_lalaport.php";
function getPCat(){
	if(window.opener)pCat = new String(document.location.hash).indexOf("MF")==-1 ? "OTHER" : "MF";
}
function shiftParent (_url) { 
	var wCat = outerLink==_url ? "OTHER" : "MF";	
	if (!window.opener || window.opener.closed) {
		openWindow(_url,wCat);
	}else{
		if(pCat==wCat){
			var p = window.opener.location.href = _url;
			window.opener.focus();
		}else{
			openWindow(_url,wCat);
		}
	}
}
function openWindow(_url,_wN){
	var p = window.open (_url, _wN);
	p.focus();
	return p;
}
//show additional info
function showInfo(aUrl){
	var w = 600;
	var h = screen.height>=800? 800 : screen.height-100;
	var wid = "detail";
	var s = (w ? ("width=" + w) : "") + (h ? (",height=" + h) : "");
	var features = "000100";
	var ss = new Array ("menubar", "toolbar", "location", "scrollbars", "status", "resizable");
	if (features)for (i in ss)	s += "," + ss [i] + "=" + features.charAt (i);
	var dw = window.open (aUrl, wid, s);
	return dw;
}
function closeWindow(){
	window.close();
}


