// -------------------------------------------------
// Flash_Paper Load 2.0
// ShemaMedia of Korea
// Version 2.0.0
// Written by Kebi and Sunny and Angma 
// -------------------------------------------------
nFWindowTitle = "JISSEN Library Guide ";
nFRoot = "http://www.jissen.ac.jp/library/ug/WEBnewszine";
nFCompany = "JS";
nFCountry = "JP";
nFCRMUrl = "";
nFWhere = document.location.href;

/*----------------------------------------------------------
  ±â´É   : Split Code RETURN Splited code by varSplitChar
  INPUT  : varString ¹®ÀÚ
     : varSplitChar ±¸ºÐÀÚ
   : varIndex ±¸ºÐÀÚÀÇ À§Ä¡
  RETURN : Splited code by varSplitChar
  ¿¹     : jsSplitCode( "111^222^333", "^", 2 ) == "222"
-----------------------------------------------------------*/
function jsSplitCode(varString, varSplitChar, varIndex) {
	var varArray = varString.split(varSplitChar) ;
	return varArray[eval(varIndex)-1];
}

locationCHK = false;

tRootURL = jsSplitCode(nFRoot, "/", 3);
tWhereURL = nFWhere.toLowerCase();

if (tWhereURL.substring(0,7) !="http://") tWhereURL = "http://" + tWhereURL;

tWhereURL = jsSplitCode(tWhereURL, "/", 3);

if (tRootURL.indexOf(tWhereURL) >=  0 || tWhereURL.indexOf(tRootURL) >=  0){
	locationCHK = true;	
}else if (tRootURL == tWhereURL){
	locationCHK = true;
}

if (locationCHK == true){
	tmpURL = "http://" + tRootURL + "/";
	nFRoot =  "http://" + tWhereURL + "/" + nFRoot.substring(tmpURL.length);
}

openurl = null;
opencolor="FFFFFF";
opencomf = nFRoot  + "/" + nFCompany + ".crt";

isIE = (navigator.appName.indexOf("Microsoft") != -1);

if (isIE){
	simurl = nFRoot  + "/Flash_Paper/Flash_Paper_IE.html";
}else{
	simurl = nFRoot  + "/Flash_Paper/Flash_Paper_Other.html";
}

function AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) {
	var leftPos= 0;
	var topPos= 0;
	var w = 480, h = 340;  
		
	if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
	
	if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
	
	if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
		if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
		if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
		if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; 
		if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
		if (winAlign.indexOf("left") != -1) leftPos = 0; 
		if (winAlign.indexOf("top") != -1) topPos = 0; 						
		
		features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;
	}
	
	if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
	
	WnzFlash = window.open(theURL,winName,features);

	if (WnzFlash.opener == null) WnzFlash.opener = self;  
	
	if (document.all || document.layers || document.getElementById) {
		if (borderless && borderless != "") {WnzFlash.resizeTo(popWidth,popHeight); WnzFlash.moveTo(leftPos, topPos);}
	}   
	
	document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}

function WEBnewszine_FLA(wnz_url){
	var URLCheck = false;

	if (nFRoot == null || locationCHK == false){
		alert("Hyper Link Denied!! (Engine)");
	}else{
		openurl = wnz_url;
		wnz_url = wnz_url.toLowerCase();
		if (wnz_url.substring(0,7) !="http://") wnz_url = "http://" + wnz_url;

		wnz_url = jsSplitCode(wnz_url, "/", 3);
		
		if (tWhereURL.indexOf(wnz_url) >=  0 || wnz_url.indexOf(tWhereURL) >=  0){
			URLCheck = true;	
		}else if (wnz_url == tWhereURL){
			URLCheck = true;
		}

		if (URLCheck == true){
			tmpURL = "http://" + wnz_url + "/";
			openurl =  "http://" + tWhereURL + "/" + openurl.substring(tmpURL.length);
		}else{
			openurl = null;
		}

		if (openurl != null)	{
			AdvOpenWindow(simurl,"WEBnewszine",'"',screen.width,screen.height,"center","","","","");
		}else{
			alert("Hyper Link Denied!! (Contents)");
		}
	}
}

