
//初めての方へ

function OpenWin_m(){
    win=window.open("/aik/mobile.html","sbwin","width=350,height=200");
}

//初めての方へ

function OpenWin_story(){
    win=window.open("intro.html","sbwin","width=650,height=500");
}

//フラワーデザインコース

function OpenWin_flower(){
	st = "scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no";
	wx = 1000;
	wy = 768;
	x = (screen.width  - wx) / 2;
	y = ((screen.height - wy) / 2) - 30;
	newwin = window.open("flower/index.html","newWinConsul","left="+x+",top="+y+",width="+wx+",height="+wy+","+st);
	newwin.focus();
}

//体験入学お申込み

function OpenWin_ocform(){
	st = "scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no";
	wx = 830;
	wy = 700;
	x = (screen.width  - wx) / 2;
	y = ((screen.height - wy) / 2) - 30;
	newwin = window.open("../form/index.html","newWinConsul","left="+x+",top="+y+",width="+wx+",height="+wy+","+st);
	newwin.focus();
}

//里親

function OpenWin_foster(){
	st = "scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no";
	wx = 830;
	wy = 700;
	x = (screen.width  - wx) / 2;
	y = ((screen.height - wy) / 2) - 30;
	newwin = window.open("/aik/fosterparent/index.html","newWinConsul","left="+x+",top="+y+",width="+wx+",height="+wy+","+st);
	newwin.focus();
}

//地震

function OpenWin_con(){
	st = "scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no";
	wx = 830;
	wy = 500;
	x = (screen.width  - wx) / 2;
	y = ((screen.height - wy) / 2) - 30;
	newwin = window.open("/aik/contribution/index.html","newWincontri","left="+x+",top="+y+",width="+wx+",height="+wy+","+st);
	newwin.focus();
}

//地震

function OpenWin_bus(){
	st = "scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no";
	wx = 930;
	wy = 700;
	x = (screen.width  - wx) / 2;
	y = ((screen.height - wy) / 2) - 30;
	newwin = window.open("/aik/bus/index.html","newWincontri","left="+x+",top="+y+",width="+wx+",height="+wy+","+st);
	newwin.focus();
}

//社会人

function OpenWin_society(){
	st = "scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no";
	wx = 930;
	wy = 700;
	x = (screen.width  - wx) / 2;
	y = ((screen.height - wy) / 2) - 30;
	newwin = window.open("/aik/society/index.html","newWinsociety","left="+x+",top="+y+",width="+wx+",height="+wy+","+st);
	newwin.focus();
}

//add azitas 20120118

var PopupWindow = function(url) {
	if (url)
		this.url = url;
	this.popupwindow = null;
	this.scrollbars = 'no';
	this.resizable = 'no';
	this.copyhistory = 'yes';
	this.width = null;
	this.height = null;
	this.left = 'center';
	this.top = 'center';
	this.winname = 'newwin';
};

PopupWindow.prototype.open = function(argv) {
	
	var option = {};
	
	if (!argv)
		argv = {};
	
	var lurl = (argv.url) ? argv.url : this.url;
	
	option.width = (argv.width) ? argv.width : this.width;
	option.height = (argv.height) ? argv.height : this.height;
	
	if (option.width && option.width == 'max') 
		option.width = screen.width;
	if (option.height && option.height == 'max') 
		option.height = screen.height;
	
	option.scrollbars = (argv.scrollbars) ? argv.scrollbars : this.scrollbars;
	option.resizable = (argv.resizable) ? argv.resizable : this.resizable;
	option.copyhistory = (argv.copyhistory) ? argv.copyhistory : this.copyhistory;
	
	option.left = (argv.left!=undefined) ? argv.left : this.left;
	if (option.left == 'center')
		option.left = (!isNaN(option.width)) ? (screen.width - option.width) / 2 : null;
		
	option.top = (argv.top!=undefined) ? argv.top : this.top;
	if (option.top == 'center')
		option.top = (!isNaN(option.height)) ? (screen.height - option.height) / 2 : null;
	
	if (option.left)
		option.screenX = option.left;
	if (option.top)
		option.screenY = option.top;
	
	if (this.popupwindow && !this.popupwindow.closed) {
		this.popupwindow.close();
	}
	
	var optionStr = '';
	for (var key in option) {
		if (option[key]!=null)
			optionStr += key+'='+option[key]+',';
	}
	
	// Output to console
	if (window.console) {
		window.console.log(optionStr);
		window.console.log('popup::'+lurl);
	}
	
	this.popupwindow = window.open(lurl, PopupWindow.getNewWindowName(argv.winname), optionStr);
	return this.popupwindow;
	
};

PopupWindow.sequence = 0;
PopupWindow.getNewWindowName = function(winname){
	//return 'win'+(PopupWindow.sequence++);
	winname="sample";
	return winname;
};



