function F_OpenWindow(url,wd,hd) {

	var swd  = screen.width;
	var parm = "";
		
	if(swd < 965){		
		parm = "resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no";
	}else{
		xpos = (swd - wd) / 2;
		ypos = (screen.height - hd) / 2;

		parm = "left="+xpos+"px,top="+ypos+"px,width="+wd+"px, height="+hd+"px, resizable=no scrollbars=no,toolbar=no,location=no,menubar=no,status=no";
	}

	var win = window.open(url,'fra_hp',parm);
	win.focus();
}

function F_OpenWindow2(url,wd,hd,fra) {

	xpos = (screen.width - wd) / 2;
	ypos = (screen.height - hd) / 2;

	parm = "left="+xpos+",top="+ypos+",width="+wd+", height="+hd+", resizable=yes, scrollbars=yes,toolbar=no,location=no,menubar=no,status=no";
	var win = window.open(url,fra,parm);
	win.focus();
}

function F_OpenWindow3(url,wd,hd,fra) {

	xpos = (screen.width - wd) / 2;
	ypos = (screen.height - hd) / 2;

	parm = "left="+xpos+",top="+ypos+",width="+wd+", height="+hd+", resizable=yes, scrollbars=no,toolbar=no,location=no,menubar=no,status=no";
	var win = window.open(url,fra,parm);
	win.focus();
}

function F_OpenWindow4(url,wd,hd,fra) {

	xpos = (screen.width - wd) / 2;
	ypos = (screen.height - hd) / 2;

	parm = "left="+xpos+",top="+ypos+",width="+wd+", height="+hd+", resizable=yes, scrollbars=yes,toolbar=no,location=no,menubar=no,status=no";
	var win = window.open(url,fra,parm);
	win.focus();
}

function F_OpenWindow5(url,wd,hd,fra) {

	xpos = (screen.width - wd) / 2;
	ypos = (screen.height - hd) / 2;

	parm = "left="+xpos+",top="+ypos+",width="+wd+", height="+hd+", resizable=no, scrollbars=yes,toolbar=no,location=no,menubar=no,status=no";
	var win = window.open(url,fra,parm);
	win.focus();
}

function F_OpenWindow6(url,wd,hd,fra) {

	xpos = (screen.width - wd) / 2;
	ypos = (screen.height - hd) / 2;

	parm = "left="+xpos+",top="+ypos+",width="+wd+", height="+hd+", resizable=no, scrollbars=no,toolbar=no,location=no,menubar=no,status=no";
	var win = window.open(url,fra,parm);
	return win;
}

function F_OpenWindowShop(url,fra) {
	var parm = "left=30,top=30,width=1000, height=750, resizable=yes,scrollbars=yes,toolbar=yes,location=yes,menubar=yes,status=yes";

	var win = window.open(url,fra,parm);
	win.focus();
}

function win_resize(w,h){
	var g_fIsSP2 = false;
    g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
    if (g_fIsSP2){
		window.resizeTo(w,h+30);
	}else{
		window.resizeTo(w,h);
    }
}

function F_OpenWindowPhoto(url,wd,hd) {

	wd = wd+40;
	hd = hd+60;

	var sw = screen.width;
	var sh = screen.height;

	if ( wd > sw ) wd = sw;
	if ( hd > sh ) hd = sh;
	xpos = (sw - wd) / 2;
	ypos = (sh - hd) / 2;

	sr = "no";
	if(xpos == 0){
		ypos=0;
		sr = "yes";
	}
	if(ypos == 0){
		xpos=0;
		sr = "yes";
	}

	parm = "left="+xpos+",top="+ypos+",width="+wd+", height="+hd+", toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+sr+",resizable=no ";
	window.open(url,'',parm);
}

function open_help_pop(baseurl, help_id) {
    winwidth  = 745;
    winheight = 580;

	xpos = (screen.width - winwidth) / 2;
	ypos = (screen.height - winheight) / 2;

	winoption = "left="+xpos+",top="+ypos+",width="+winwidth+",height="+winheight+",scrollbars=no,resizable=no";
	subwin = window.open(baseurl+"info/help/help_pop.php?help_id="+help_id, "POP_HELP", winoption);
	subwin.focus();
}

function open_help_pop_1(baseurl, help_id, location_id) {
    winwidth  = 745;
    winheight = 580;

	xpos = (screen.width - winwidth) / 2;
	ypos = (screen.height - winheight) / 2;

	winoption = "left="+xpos+",top="+ypos+",width="+winwidth+",height="+winheight+",scrollbars=no,resizable=no";
	subwin = window.open(baseurl+"info/help/help_pop.php?help_id="+help_id+"&location_id="+location_id, "POP_HELP", winoption);
	subwin.focus();
}

function MM_openBrWindow(txt,txt_color) { //v2.0

	wd      = 400;
	hd      = 260;
	winName = "pop_color";
	theURL  = "color_chart.html?f_txt="+txt+"&f_txt_color="+txt_color;

	xpos = (screen.width - wd) / 2;
	ypos = (screen.height - hd) / 2;

	parm = "left="+xpos+",top="+ypos+",width="+wd+", height="+hd+", resizable=yes, scrollbars=no,toolbar=no,location=no,menubar=no";
	window.open(theURL,winName,parm);
}


function F_OpenWindow(url,wd,hd) {

	var swd  = screen.width;
	var parm = "";
		
	if(swd < 965){		
		parm = "resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no";
	}else{
		xpos = (swd - wd) / 2;
		ypos = (screen.height - hd) / 2;

		parm = "left="+xpos+"px,top="+ypos+"px,width="+wd+"px, height="+hd+"px, resizable=no scrollbars=no,toolbar=no,location=no,menubar=no,status=no";
	}

	var win = window.open(url,'fra_hp',parm);
	win.focus();
}

function F_ShowAbaFace(xUrl,xWd,xHd,xDepth,xType){
	var xParent = "";
	xParent = F_ParentDepth(xDepth);
	if(xParent == ""){
		if(xType == 1){
			location.href=xUrl;
		}else{
			F_OpenWindow(xUrl,xWd,xHd);
		}
	}else{
		var xObj = eval(xParent);
		if(xType == 1){
			xObj.location.href=xUrl;
		}else{
			xObj.F_OpenWindow(xUrl,xWd,xHd);
		}	
	}
}

function F_ParentDepth(xDepth){
	var xParent = "";
	var i = 0;
	if(xDepth>0){
		for(i=0;i<xDepth;i++){
			if(xParent == ""){
				xParent = xParent + "parent";
			}else{
				xParent = xParent + ".parent";
			}
		}
	}
	return xParent;
}