﻿/*
##################################################
#This javascript was made on January 31, 2003.
#It is responsible for a MEDAL Co,Ltd.
#Responsibility is not taken although use is free.
##################################################
#nn4 reload & window resize bugfix
#reloads the window if Netscape4x resized.
#copyright macromedia.Co, Ltd.
##################################################
*/

function MM_reloadPage(init){
	if( init==true ){
		with( navigator ){
			if(( appName.charAt(0)=="N" )&&( parseInt(appVersion)<=4 )){
				document.MM_pgW=innerWidth;
				document.MM_pgH=innerHeight;
				window.onresize = MM_reloadPage; 
			}
		}
	}else if((innerWidth!=document.MM_pgW)||(innerHeight!=document.MM_pgH)) location.reload();
}

MM_reloadPage(true);


function MM_showHideLayers(){ //v6.0
	var i, p, v, obj;
	var args = MM_showHideLayers.arguments;

	for (i=0; i<(args.length-2); i+=3){
		if(( obj = MM_findObj(args[i])) != null){
			v = args[i+2];
			if( obj.style ){
				obj = obj.style;
				v = (v == 'show')?'visible':(v == 'hide')?'hidden':v;
			}
			obj.visibility = v;
		}
	}

}

function MM_findObj( n, d ){ //v4.01
	var p, i, x;
	if(!d) d = document;

	if((p = n.indexOf("?")) >0 && parent.frames.length){
		d = parent.frames[n.substring(p+1)].document;
		n = n.substring( 0, p );
	}

	if(!(x = d[n]) && d.all){ //ie4 lower or ie5up
		x = d.all[n];
		for(i=0; !x&&i<d.forms.length; i++){
			x=d.forms[i][n];
		}
	}

	for(i=0; !x&&d.layers&&i<d.layers.length; i++){
		x = MM_findObj( n, d.layers[i].document ); //ns4 lower
	}

	if(!x && d.getElementById) x=d.getElementById(n); //ie5up or ns6up

	return x;
}


/*
###################################
#menu pushbutton script
###################################
*/
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;

		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
			//alert(changeImages.arguments[i+1]);
		}
	}
}

var preloadFlag = false;

function preloadImages( imgpath ) {
	var imageList = new Array();

	if (document.images) {
		//preload images
		imageList[0] = "";
		//main Navi
		imageList[imageList.length++] = newImage(imgpath+"images/common/home_on.gif");
		imageList[imageList.length++] = newImage(imgpath+"images/common/menu_on.gif");
		imageList[imageList.length++] = newImage(imgpath+"images/top/samplebtn_on.gif");
		preloadFlag = true;
	}
}


/*
###################################################################
#open window method
#The value of the argument of windowSize is 'width=***,height=***'
#features is  [ true | false | Array ]
###################################################################
*/
function WindowFeaturesItem( foption ){ //features option.
	var wf = "";
	wf = "toolbar=" + (foption[0] ? "yes" : "no");
	wf += ",location=" + (foption[1] ? "yes" : "no");
	wf += ",directories=" + (foption[2] ? "yes" : "no");
	wf += ",status=" + (foption[3] ? "yes" : "no");
	wf += ",menubar=" + (foption[4] ? "yes" : "no");
	wf += ",scrollbars=" + (foption[5] ? "yes" : "no");
	wf += ",resizable=" + (foption[6] ? "yes" : "no");

	return wf;
}


function openWin( theUrl, windowName, features, windowSize, x, y ){
	var is = new Is_env();

	// windowhight is adjusted at the time of Mac ie4.5.
	if( is.MAC && is.IE && is.IE45 ) var adjusth = 2;
	else var adjusth = 0;
	
	var H = parseInt( windowSize.substring(17,20)) + adjusth;
	var winSize = new String( windowSize.substring(0,17) + H ); //String constructor is set up.
	
	if((features==true)||(features==false)){
		var f = new Array();
		for(i=0; i<7; i++){
			f[i] = features;
		}
		var wfeatures = WindowFeaturesItem(f);
	}else{
		var wfeatures = WindowFeaturesItem( features ); //window features setting.
		//alert( wfeatures );
	}

	// It arranges it at the center.
	//var x = parseInt((screen.width - parseInt( windowSize.substring(6,9) )) / 2);
	var y = parseInt((screen.height - H) / 2);

	var windowPosition = ( ",top=" + x + ",left=" + y );
	wfeatures += ( "," + winSize + windowPosition );
	//alert( wfeatures );

	new_window = window.open( theUrl, windowName, wfeatures ); //window open method.
	new_window.focus();
	//new_window.moveTo( x, y );
}


function ShowLargeImgWin( imgName, imgW, imgH, features, x, y, altTitle ){
	if((features==true)||(features==false)){
		var f = new Array();
		for(i=0; i<7; i++){
			f[i] = features;
		}
		var wfeatures = WindowFeaturesItem(f);
	}else{
		var wfeatures = WindowFeaturesItem( features ); //window features setting.
		//alert( wfeatures );
	}

	//var x = parseInt((screen.width - imgW) / 2);
	var y = parseInt(( screen.height - imgH ) / 2);
	var windowPosition = ( ",top=" + x + ",left=" + y );
	var newfeatures = '"'+ wfeatures +',width='+ imgW +',height='+ imgH + windowPosition +'"';
	//alert(newfeatures);

	//var windowSize = 'width='+imgW+',height='+imgH;
	//newWindow = openWin( "", "newSubWindow", false, windowSize, 0, 0 );

	newSubWindow = window.open( "", "newSubWindow", newfeatures );
	newSubWindow.document.open("text/html");
	newSubWindow.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n');
	newSubWindow.document.write('<html lang="ja" dir="ltr">\n');
	newSubWindow.document.write('<head>\n');
	newSubWindow.document.write('<meta http-equiv="Content-Language" content="ja" />\n');
	newSubWindow.document.write('<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />\n');
	newSubWindow.document.write('<meta http-equiv="Content-Style-Type" content="text/css" />\n');
	newSubWindow.document.write('<meta http-equiv="Content-Script-Type" content="text/javascript" />\n');
	newSubWindow.document.write('<meta http-equiv="imagetoolbar" content="no" />\n');
	newSubWindow.document.write('<title>'+ altTitle +'</title>\n');
	newSubWindow.document.write('<script language="JavaScript" type="text/javascript" src="../../lib/default.js"></script>\n');
	newSubWindow.document.write('<script language="JavaScript" type="text/javascript" src="../../lib/base.js"></script>\n');
	newSubWindow.document.write('</head>\n');
	newSubWindow.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.closeWin();" onClick="self.closeWin(); return false;">\n');
	newSubWindow.document.write('<div id="Largeimage">\n');
	newSubWindow.document.write('<img src="'+ imgName +'.jpg" width="'+ imgW +'" height="'+ imgH +'" alt="'+ altTitle +'" title="'+ altTitle +'" />\n');
	newSubWindow.document.write('</div>\n');
	newSubWindow.document.write('</body>\n');
	newSubWindow.document.write('</html>');
	newSubWindow.document.close();
	newSubWindow.focus();
}



/*
#################################
#closed window method
#################################
*/
function onErrMacWinClose(){
	closeWin();
	return true;
}

function closeWin(){
	var is = new Is_env();

	if( is.MAC && is.IE4X ) window.onerror = onErrMacWinClose;
	if( !this.closed ) this.close();
}


/*
#########################################################################
#scroll potion method.
#ex.JavaScript:doPageScroll('up', -100) or doPageScroll('down', 500)
#########################################################################
*/
function doScroller( action, pram ){
	if (action == 'up'){ //scroll up action
		if (pram == screen.availHeight) var y = 0;
		else var y = 1000;

		y = y +(pram - y)*.1;
		while(y != pram){
			window.scroll(0, y);
			y = y + (pram - y)*.1;
			//window.status = "pram is : " +pram+ ", Y is : " +y;
			if (((pram - y) <= .5)&&((pram - y) >= -.5)) y = pram;
		}
	}else if (action == 'down'){ //scroll down action1
		y = 1;
		boundary = pram*.5;

		while(y <= boundary){
			window.scroll(0, y);
			y = y +(y*.3);
			if (((boundary - y) <= .5)&&((boundary - y) >= -.5)) y = boundary;
		}

		while(y != pram){
			window.scroll(0, y);
			y = y +(pram - y)*.1;
			if (((pram - y) <= .5)&&((pram - y) >= -.5)) y = pram;
		}
	}else{ //scroll down action2
		y = 0;
		y = y +(pram - y)*.1;

		while(y != pram){
			window.scroll(0, y);
			y = y +(pram-y)*.1;
			if (((pram - y) <= .5)&&((pram - y) >= -.5)) y = pram;
		}
	}
}

/*
######################################################################
#Side Scroll Page method
#<a href="javascript: slidePageTo(500)">x座標=500の位置へ移動</a>
#<a href="javascript: slidePageBy(300)">右に300ピクセル移動</a>
#<a href="javascript: slidePageBy(-300)">左に300ピクセル移動</a>
######################################################################
*/
var moveID = false;
var pos = 0;

function slideMe_left(n) {
	pos += Math.ceil((n-pos)*0.07);
	self.scroll(pos,0);
	if ((n-pos) <= 1) {
		pos = n;
		self.scroll(n,0);
		clearTimeout(moveID);
		moveID = false;
		return;
	}
	moveID = setTimeout("slideMe_left(" + n + ")",0);
}

function slideMe_right(n) {
	pos -= Math.ceil((pos-n)*0.07);
	self.scroll(pos,0);
	if (Math.abs(n-pos) <= 1) {
		pos = n;
		self.scroll(n,0);
		clearTimeout(moveID);
		moveID = false;
		return;
	}
	moveID = setTimeout("slideMe_right(" + n + ")",0);
}

function slidePageTo(n) {
	if(!moveID) {
		var d = (n>pos)? "left" : "right";
		var f ="slideMe_"+ d +"(" + n + ")";
		moveID = setTimeout(f,0);
	}
}

function slidePageBy(n) {
	if(!moveID) {
		var d = (n>0)? "left" : "right";
		var f ="slideMe_"+ d +"(" + (pos+n) + ")";
		moveID = setTimeout(f,0);
	}
}


/*
##################################################
#The size of the parents window is acquired and
#it reflects it in the child window.
##################################################
*/
/* RESIZE WINDOW METHOD */
function checkWindowSize() {
	var is = new Is_env();
	var size = new Array();

	if(is.IE && is.GET_ELEMENT_ID && is.CSS1COMP){
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
		//alert('documentElement');
	}else if(is.IE){
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}else{
		w = window.innerWidth;
		h = window.innerHeight;
	}

	size[0] = w;
	size[1] = h;

	return size;
}

function focusWin(file, target) {
	var size = checkWindowSize();
	var newWin = openWin( file, target, true, 'width='+size[0]+',height='+size[1], 0, 0 );
}


/*
##################################################
#The script for branching Windows IE..
#In this case, the file of VBScript.
##################################################
*/

function check_vbscript( path ){
	var is = new Is_env();
	document.open("text/html");

	if(is.WIN && document.all && !is.OPERA){
		document.write('<script language="VBScript" type="text/VBScript" src="'+path+'js/flashCheck.vbs"></scr'+'ipt>');
	}

	document.close();
}

/*
function load_lightWindow( path ) {
	document.open("text/html");
	document.write('<script type="text/javascript" src="'+path+'js/prototype.js"></script>');
	document.write('<script type="text/javascript" src="'+path+'js/effects.js"></script>');
	document.write('<script type="text/javascript" src="'+path+'js/lightwindow.js"></script>');
	document.close();
}
*/

/*
###################################
#writing footer method
###################################
*/
function writefooter( path ){
	var is = new Is_env(); 
	var target = new Date();
	var year = new Array();

	if(!is.NN40X_LOW){
		var _year = target.getFullYear();
	/*
		for(i=0; i<4; i++){
			year[i] = (_year.toString()).substring(i, i+1);
		}
	*/
	}else{
		if( target.getYear() >= 2000 ) var _year = target.getYear();
		else var _year = target.getYear()+1900;
	/*
		for(i=0; i<4; i++){
			year[i] = (_year.toString()).substring(i, i+1);
		}
	*/
	}

	document.open("text/html");
	document.write('<table cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr>');
	document.write('<td width="56" rowspan="2" valign="top"><img src="'+path+'images/common/logo.gif" width="56" height="71" border="0" alt="Get! Sports Sponsor" title="Get! Sports Sponsor" class="mr10"></td>');
	document.write('<td><img src="'+path+'images/common/logo-copy.gif" width="212" height="53" border="0" alt="Get! Sports Sponsor" title="Get! Sports Sponsor"></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td class="spaceNowrap"><p class="detail">Copyright (C) '+_year+' I style planning office. All Rights Reserved.</p></td>');
	document.write('</tr>');
	document.write('</table>');
	document.close();
/*
	document.open("text/html");
	document.write('<address>');
	document.write('<img src="'+path+'images/common/copy01.gif" width="55" height="13" border="0">');
	document.write('<img src="'+path+'images/common/year_'+year[0]+'.gif" width="6" height="13" border="0">');
	document.write('<img src="'+path+'images/common/year_'+year[1]+'.gif" width="6" height="13" border="0">');
	document.write('<img src="'+path+'images/common/year_'+year[2]+'.gif" width="6" height="13" border="0">');
	document.write('<img src="'+path+'images/common/year_'+year[3]+'.gif" width="6" height="13" border="0">');
	document.write('<img src="'+path+'images/common/copy02.gif" width="197" height="13" border="0" alt="Copyright(C)'+_year+' KANKO Corporation All Right Reserved." title="Copyright(C)'+_year+' KANKO Corporation All Right Reserved.">');
	document.write('</address>');
	document.close();
*/
}

function writecopyright(path){
	var is = new Is_env(); 
	var target = new Date();
	var year = new Array();

	if(!is.NN40X_LOW){
		var _year = target.getFullYear();
	}else{
		if( target.getYear() >= 2000 ) var _year = target.getYear();
		else var _year = target.getYear()+1900;
	}

	document.open("text/html");
	document.write('<p>');
	document.write('<img src="'+path+'images/s08/style_logo.gif" width="92" height="28" border="0" alt="I Style" title="I Style" class="vermiddle mr10">');
	document.write('Copyright (C) '+_year+' I style planning office. All Rights Reserved.');
	document.write('</p>');
	document.close();
	
}

/*
###################################
#WRITE INLINEFRAME method
###################################
*/
function writeIframe(path, w, h){
	var is = new Is_env();

	if(is.IE5X_UP || is.OPERA){
		var scroll = "yes";
	}else{
		var scroll = "auto";
	}

	document.open("text/html");
	document.write('<iframe src="'+path+'lineup.html" width="'+w+'" height="'+h+'" marginWidth="0" marginHeight="0" frameBorder="0" border="0" scrolling="'+scroll+'" allowtransparency="true" class="mt4 mb4"><noiframe>iframe対応のブラウザでご覧下さい。</noiframe></iframe>');
	document.close();
}

/*
###################################
#Blink method
###################################
*/
function blink() {
	if (!document.all) { return; }
	for (i = 0; i < document.all.length; i++) {
		obj = document.all(i);
		if (obj.className == "blink") {
			if (obj.style.visibility == "visible") {
				obj.style.visibility = "hidden";
			} else {
				obj.style.visibility = "visible";
			}
		}
	}
	setTimeout("blink()", 1000);
}

/*
###################################
#Stting of Google Analytics method
###################################
*/
/*
function getGoogleAnalyticsSrc() {
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.open("text/html");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	document.close();
}

function getGoogleAnalytics(pram) {
	if(pram == "kanko-sp"){
		//kanko-sp Traking code
		var pageTracker = _gat._getTracker("UA-3727156-1");
	}else{
		//sugure-mono.net Traking code
		var pageTracker = _gat._getTracker("UA-3727156-2");
	}

	pageTracker._initData();
	pageTracker._trackPageview();
}
*/