﻿//JS
document.write('<script type"text/javascript" src="./config.js"></script>');


//PUBLIC_WEB_HOST
//PUBLIC_IMAGE_HOST

/* 
 * @param	SWF FILE PATH
 * @param	WIDTH
 * @param	HEIGHT
 * @param	FLASHVARS
 * @param	BG COLOR ( DEFAULT:000000 )
 **/
function createFlashObj( _swfFilePath , _width , _height , _flashVars , _color ){
	if( _color == undefined ){
		_color = 'FFFFFF';
	}
	var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
	+ 'width="' + _width + '" height="' + _height + '"'
	+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
	+ '<param name="movie" value="' + getImagePath( _swfFilePath ) +document.location.search+ '" />'
	+ '<param name="loop" value="false" />'
	+ '<param name="menu" value="false" />'
	+ '<param name="quality" value="high" />'
	+ '<param name="scale" value="noscale" />'
	+ '<param name="bgcolor" value="#' + _color + '" />'
	+ '<param NAME=FlashVars VALUE="' + _flashVars + '">'
	+ '<embed src="'+ getImagePath( _swfFilePath ) +document.location.search+ '" loop="false" menu="false" quality="high" scale="noscale" bgcolor="#' + _color + '" '
	+ 'width="' + _width + '" height="' + _height + '" name="index" align="middle"'
	+ 'play="true"'
	+ 'loop="false"'
	+ 'quality="high"'
	+ 'FlashVars="' + _flashVars + '"'
	+ 'allowScriptAccess="sameDomain"'
	+ 'type="application/x-shockwave-flash"'
	+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
	+ '<\/embed>'
	+ '<\/object>';
	//alert(oeTags);
	document.write(oeTags);
}

function createFlashObj2( _swfFilePath , _flashVars , _color ){
	if( _color == undefined ){
		_color = '000000';
	}
	var oeTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
	+ 'width="100%" height="100%"'
	+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
	+ '<param name="movie" value="' + getImagePath( _swfFilePath ) +document.location.search+ '" />'
	+ '<param name="loop" value="false" />'
	+ '<param name="menu" value="false" />'
	+ '<param name="quality" value="high" />'
	+ '<param name="scale" value="exactfit" />'
	+ '<param name="salign" value="lt" />'
	+ '<param name="bgcolor" value="#' + _color + '" />'
	+ '<param NAME=FlashVars VALUE="' + _flashVars + '">'
	+ '<embed src="'+ getImagePath( _swfFilePath ) +document.location.search+ '" loop="false" menu="false" quality="high" scale="exactfit" salign="lt" bgcolor="#' + _color + '" '
	+ 'width="100%" height="'+screen.availHeight+'" name="index" align="middle"'
	+ 'play="true"'
	+ 'loop="false"'
	+ 'quality="high"'
	+ 'FlashVars="' + _flashVars + '"'
	+ 'allowScriptAccess="sameDomain"'
	+ 'type="application/x-shockwave-flash"'
	+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
	+ '<\/embed>'
	+ '<\/object>';
	//alert(oeTags);
	document.write(oeTags);
}



function createImage( _imageFilePath , _width , _height , _option ){
	document.write('<img src="' + getImagePath( _imageFilePath ) + '" width="' + _width + '" height="' + _height + '" border="0" ' + _option + ' >');
}


function getImagePath( _imageFilePath ){
	return PUBLIC_IMAGE_HOST + _imageFilePath;
}


//open WIN+fullscreen
function openWin(url) {
	var strURL = url;
	var strName = 'FULLSCREEN';
	var strOptions = ' scrollbars=0,resizable=yes,menubar=0,toolbar=0,status=0,location=0,directories=0';
	fullscreen = window.open(strURL, strName, 'left=0 ,top=0,' + strOptions);
 	if (fullscreen.focus) {
 	fullscreen.focus();
 	}
}


//ease 
var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
var Win = navigator.appVersion.indexOf('Win',0) != -1;
var IE  = navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1;
var NN  = navigator.appName.indexOf("Netscape",0) != -1;
var GE  = navigator.userAgent.indexOf("Gecko") != -1;



//gotoTop
function gotoTop(){
  if( IE ){
    position = document.body.scrollTop;
  } else {
    position = window.pageYOffset;
  } movePosition()
}
function movePosition(){
  position = Math.floor(position*0.75);
  if( position > 0.1 ){
    window.scrollTo(0,position)
    setTimeout("gotoTop()",50);
  } else { window.scrollTo(0,0) }
}
