

function subwin() {
        if(s_window.opener==null)s_window.opener=window;
s_window.focus();
}

function openPopup1(url) {
	openBrWindow(url,"photo",600,500,"center","scrollbars=no");
}

function openPopup2(url) {
	openBrWindow(url,"photo2",800,470,"center","scrollbars=yes");
}


function openPopup(url) {
	openBrWindow(url,"photo",300,480,"center","scrollbars=no");
}

function openPopup4(url) {
	openBrWindow(url,"photo2",600,470,"center","scrollbars=yes");
}


//dw  ->  Difference of width
//dh  ->  Difference of height
//rdw ->  Difference of width when there is resize

var Mac = navigator.userAgent.indexOf('Mac') != -1;
var Win = navigator.userAgent.indexOf('Win') != -1;
var bwr_ns = navigator.appName.indexOf("Netscape")  != -1;
var bwr_ie = navigator.appName.indexOf("Microsoft") != -1;
var bwr_ge = navigator.userAgent.indexOf("Gecko") != -1;
var bwr_sa = navigator.appVersion.indexOf("Safari") != -1;
	
	// Macintosh////////////////////////////////////////////////////////////
if (Mac) {
	if (bwr_ns) {
		dw=dh=0;
		rdw=15;
	}
	if (bwr_ie) {
		dw=dh=-15;
		rdw=-1;
	}
	if (bwr_ge) {
		dw=dh=0;
		rdw=15;
	}
	if (bwr_sa) {	
		dw=0;
		dh=1;
		rdw=15;
	}
}
	// Windows////////////////////////////////////////////////////////////
else if (Win) {
	if (bwr_ns) {
		dw=dh=0;
		rdw=15;
	}
	if (bwr_ie) {
		dw=dh=0;
		rdw=17;
	}
	if (bwr_ge) {
		dw=dh=0;
		rdw=19;
	}
}else{
	dw=dh=0;
	rdw=0;
}


function openBrWindow(theURL,winName,w,h,p,features) {
	if(p=="center"){
		x = ((screen.availWidth) / 2) - (w / 2);
		y = ((screen.availHeight) / 2) - (h / 2);
	}else if(p=="right"){
		x = screen.availWidth - w;
		y = 0;	
	}else{
		x = 0;
		y = 0;		
	}
	
	if(features==""){
		features="width="+(w+dw)+",height="+(h+dh)+",left="+x+",top="+y;
	}else{
		features="width="+(w+rdw)+",height="+h+",left="+x+",top="+y+","+features;
	}
	sub_win=window.open(theURL,winName,features);
	if(sub_win.opener==null){
		sub_win.opener=window;
	}
	sub_win.focus();
}

function openBrWindow(theURL,winName,w,h,p,features) {
	if(p=="center"){
		x = ((screen.availWidth) / 2) - (w / 2);
		y = ((screen.availHeight) / 2) - (h / 2);
	}else if(p=="right"){
		x = screen.availWidth - w;
		y = 0;	
	}else{
		x = 0;
		y = 0;		
	}
	
	if(features==""){
		features="width="+(w+dw)+",height="+(h+dh)+",left="+x+",top="+y;
	}else{
		features="width="+(w+rdw)+",height="+h+",left="+x+",top="+y+","+features;
	}
	sub_win=window.open(theURL,winName,features);
	if(sub_win.opener==null){
		sub_win.opener=window;
	}
	sub_win.focus();
}

//////////////////////////////////////////////////////////////////

var target_flash_Ver = 8;

//plugin check
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {

	//plugin version check
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	for (var i = 0; i < words.length; ++i){
		if (isNaN(parseInt(words[i])))
		continue;
		var PluginVersion = words[i]; 
	}

	var FlashCanPlay = PluginVersion >= target_flash_Ver;

}else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {

	//for windows Internet explorer
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & target_flash_Ver)))\n');
	document.write('</SCR' + 'IPT\> \n');
}



function dispContent (flashDataObj,  NO_flashDataObj) {
	if ( FlashCanPlay ) {
		swfName = flashDataObj.swfName;
		swfWidth = flashDataObj.swfWidth;
		swfHeight = flashDataObj.swfHeight;
		swfBgColor = flashDataObj.swfBgColor;
		custom_embed(swfName, swfWidth, swfHeight, swfBgColor);
	} else{
		dispImage(NO_flashDataObj);
	}
}

function custom_embed(swfName, swfWidth, swfHeight, swfBgColor){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width=" + swfWidth + " height=" + swfHeight + ">");
	document.write("<param name=movie value=" + swfName + ">");
	document.write("<param name=bgcolor value=" + swfBgColor + ">");
	document.write("<param name=quality value=high>");
	document.write("<param name=menu value=false>");
	//document.write("<param name=wmode value=transparent>");
	
	document.write("<embed src=" + swfName + " menu=false quality=high pluginspage='http://www.macromedia.com/jp/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' bgcolor=" + swfBgColor +" width=" + swfWidth + "  height=" + swfHeight + "></embed>"); 
	document.write("</object>");
}


function dispImage(NO_flashDataObj) {
	document.write(NO_flashDataObj);
}
