///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///  	특정 페이지 SSL적용을 위한 apssl스크립트
///	작성자 : ibm 옥일권, ikouk@kr.ibm.com
///	작성일 : 2007-10-31
///	변경이력 :
///	설 명 :
///		- 이 스크립트가 사이트 전체에 include되도록 한다.
///		- 브라우져 상의 주소를 읽어서 지정된 SSL적용 대상 페이지인지 확인 한 후 개발서버가 아닌 운영서버일경우 SSL페이지면 https://로 주소를 redirect
///		- SSL적용 대상 페이지가 아니면서 https://주소를 사용하고 있을 경우 http://로 redirect		///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//ssl직접 적용페이지 - vipShopList.jsp, order.do?method=orderFrm(주문)

//SSL적용 대상 페이지를 $를 이용하여 구분하여 지정
//var sslPageList = "/login.do$/order.do";
var sslPageList = "/login.do$/pop_login_nomember.jsp$/pop_login_nomember_buy.jsp$/login_popup.jsp$/order.do$/membership.do$/myEtude.do?method=memberInfo$/myEtude.do?method=memberEditForm$/orderNew.do$/claim.do";
var sslSWPageList = "/zipCode.do$/AddrListPopup.do$/AddrEdit.do$/AddrAction.do$/delivery.do"; //ssl페이지에 소속되었으나 ssl이 필요치않은페이지
var strSecureUrl = "https://www.etude.co.kr";	//운영 - 직접 ssl url 를 붙여야 사용해야할때...(폼전송으로 넘어가는 경우)
//var strSecureUrl = "http://220.64.130.41:8093";	//개발
//var strSecureUrl = "/";	//로컬
var certiDomain = "www.etude.co.kr";

//	검색엔진 기능 제거  제거하기 위해서 'NO'를 해준다.
var isSearchEnabled = 'YES';
//	상품당주문수량제한
var ORDER_LIMIT = 20;

//강제 실행 스크립트
goSSL();

if(document.URL.indexOf('/opt') >= 0 || document.URL.indexOf('/admin') >= 0 ) {
	document.title = 'etude';
}
else {
	document.title = '달콤한 상상~ 에뛰드하우스';
}

document.write("<link rel='shortcut icon' href='/images/common/favicon.ico'>");
	
		
function goSSL(){
	try{
		var addr = document.location.href;
		if(isSSLPageCheck(addr)){
			if(addr.indexOf("https")<0 && isIPCheck(addr)==false){
				var targetUrl = addr.replace("http://","https://");
				var cDomain= "";

				try{
					cDomain = certiDomain;			//sslpagelist.js에 정의된 인증도메인(certiDomain)을 불러온다.
				}catch(e){
					;;					//인증도메인이 없으면 Skip
				}

				if(cDomain != ""){		//인증도메인이 있을 경우만 현재 도메인과 인증 도메인 일치 여부를 검사한다.
					if(document.domain.toLowerCase()!=certiDomain.toLowerCase()){	//현재 도메인과 인증 도메인이 불일치 할 경우
						targetUrl = targetUrl.replace(document.domain,cDomain);	//이동할 도메인을 인증 도메인으로 변경한다.
					}
				}
				document.location.href = targetUrl;
			}			
		}else{
			if(addr.indexOf("https://")>-1 && !isSSLSWPageCheck(addr)){
				document.location.href = addr.replace("https://","http://");
			}
		}
	}catch(e){
		//alert(e.message); //- 디버깅시 사용
	}
}

//상단에 정의된 SSL페이지인지 여부를 반환 (true: SSL적용페이지, false:비대상 페이지)
function isSSLPageCheck(_url){
	if(document.getElementById("sslpageyn")!=null && document.getElementById("sslpageyn").value=="yes"){
		return true;
	}

	arrSSLs = sslPageList.split("$");
	for(i=0; i<arrSSLs.length;i++){
		if(arrSSLs[i]!="" && _url.indexOf(arrSSLs[i])>-1)
			return true;
	}
	return false;
}

//전달받은 주소가 아이피형식인지 체크-개발서버를 가려내기 위함(true:아이피형주소, false:도메인형주소)
function isIPCheck(_url){
	_url = _url.replace("https://","");
	_url = _url.replace("http://","");
	arrDgit = _url.split(".");			
	isIP = true;
	if(arrDgit.length>4){
		for(i=0; i<3; i++){
			if(arrDgit[i].search(/[^0-9]/g)!=-1){
				return false;
			}
		}
	}else{
		return false;
	}			
	return true;
}

//상단에 정의된 SSL 적용/미적용 구분
function isSSLSWPageCheck(_url){

	arrSSLs = sslSWPageList.split("$");
	for(i=0; i<arrSSLs.length;i++){
		if(arrSSLs[i]!="" && _url.indexOf(arrSSLs[i])>-1)
			return true;
	}
	return false;
}

// 주소가 dev.etude.co.kr 도메인을 사용하는 개발 서버 인지 확인
function isDev(url) {
	return url.indexOf( "dev.etude.co.kr" ) != 1;
}

// quick
function getPosition(){
	var start, end, scale, term, max;

	start = parseInt (document.getElementById('quick').style.top, 0) - 119;
	end = document.getElementById("container").scrollTop + 0;
	max = document.getElementById("containerBg").offsetHeight - document.getElementById('quick').offsetHeight - 280;
	if(end > max) end = max;
	term = 5;

	if ( start != end ) {
		scale = Math.ceil( Math.abs( end - start ) / 20 );
		if ( end < start ) scale = -scale;
		document.getElementById('quick').style.top = parseInt (document.getElementById('quick').style.top, 0)+ scale + "px";
		term = 1;
	}
	setTimeout ("getPosition()", term);
}
function moveBanner() {
	document.getElementById('quick').style.top = 119 + document.getElementById("container").scrollTop + 0 + "px"; //숫자가 같으면 슬라이드 없다.
	getPosition();
	return true;
}

// quick3
function getPosition2(){
	var start, end, scale, term, max;

	start = parseInt (document.getElementById('quick3').style.top, 0) - 119;
	end = document.getElementById("container").scrollTop + 0;
	max = document.getElementById("containerBg").offsetHeight - document.getElementById('quick3').offsetHeight - 280;
	if(end > max) end = max;
	term = 5;

	if ( start != end ) {
		scale = Math.ceil( Math.abs( end - start ) / 20 );
		if ( end < start ) scale = -scale;
		document.getElementById('quick3').style.top = parseInt (document.getElementById('quick3').style.top, 0)+ scale + "px";
		term = 1;
	}
	setTimeout ("getPosition2()", term);
}
function moveBanner2() {
	document.getElementById('quick3').style.top = 119 + document.getElementById("container").scrollTop + 0 + "px"; //숫자가 같으면 슬라이드 없다.
	getPosition2();
	return true;
}

//* image rollover *//
function overRoll( obj ) {
    obj.src = obj.src.replace( 'off.gif', 'on.gif' );
}
function outRoll( obj ) {
    obj.src = obj.src.replace( 'on.gif', 'off.gif' );
}

//<![CDATA[
	function chgHeadingTab(el) {
		if (!document.getElementsByTagName) return false;
		var tabtag = el;
		var headings = new RegExp("[h1-6]","i");
		while (!headings.test(tabtag.tagName)) {
			tabtag = tabtag.parentNode;
		}
		if (!headings.test(tabtag.tagName)) return false;
		var tabparent = tabtag.parentNode;
		tabtag = tabtag.tagName;
		var clickedtab = el;
		while (clickedtab.tagName != tabtag) {
			clickedtab = clickedtab.parentNode;
		}
		var tabitems = tabparent.getElementsByTagName(tabtag);
		for (var i=0; i<tabitems.length; i++) {
			var tabimg = tabitems[i].getElementsByTagName("IMG")[0];
			var tabcont = tabitems[i].nextSibling;
			while (tabcont.nodeType != 1) {
				tabcont = tabcont.nextSibling;
			}
			if (tabitems[i] == clickedtab) {
				tabimg.src = tabimg.src.replace("_off.gif","_on.gif");
				tabcont.style.display = "block";
			} else if (tabitems[i] != clickedtab) {
				if (tabimg.src.indexOf("_on.gif") != -1) {
					tabimg.src = tabimg.src.replace("_on.gif","_off.gif");
				}
				tabcont.style.display = "none";
			}
		}
		return false;
	}

	function overImg(obj) {
		obj.src = obj.src.replace( 'off.gif', 'on.gif' );
	}
	function outImg(obj) {
		if (chkContOn(obj)) return false;
		obj.src = obj.src.replace( 'on.gif', 'off.gif' );
	}
	function chkContOn(el) {
		var tab = el;
		var headings = new RegExp("[h1-6]","i");
		while (!headings.test(tab.tagName)) {
			tab = tab.parentNode;
		}
		if (!headings.test(tab.tagName)) return false;
		var tabcont = tab.nextSibling;
		while (tabcont.nodeType != 1) {
			tabcont = tabcont.nextSibling;
		}
		return tabcont.style.display != "none" ? true : false;
	}
//]]>


// getFlash
function getFlash(swfName,wt,ht,id){
 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+wt+'" height="'+ht+'" id="'+id+'">');
 document.write('<param name="movie" value="'+swfName+'">');
 document.write('<param name="quality" value="high">');
 document.write('<param name="wmode" value="transparent">');
 document.write('<param name="allowScriptAccess" value="always">');
 document.write('<embed src="'+swfName+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="'+wt+'" height="'+ht+'" allowScriptAccess="sameDomain" id="'+id+'"></embed></object>');
}



//------------------- SWF 제어함수 시작
/**
 *	version 1.5
 *	최종수정일 : 2008. 11. 10
 *
 *	-- 플래시로더 객체생성 기본사용방법 ---
 *	<script language="javascript" type="Text/JavaScript">
 *		var setFlash = new SWFLoader();
 *		setFlash.init( '넓이', '높이', '파일경로', 총 매개변수값);
 *		setFlash.parameter('파람이름','값'); //이미 기본옵션 사용중
 *		setFlash.wmode('window'); //이미 기본옵션('transparent') 사용중
 *		setFlash.id('아이디이름'); //예) ID_SWF파일이름
 *		setFlash.alt('값');	// 플래시 대체 텍스트 값 입력
 *		setFlash.layer('div 아이디 이름')  //예) <div id='SWF파일명Layer'></div>
 *		setFlash.show( );
 *	</script>
 *
 *	SWF파일 아이디 표준화 사용방법 : ID_파일명(대소문자구분) 예제 : 파일명이 navi.swf 인경우 --> 'ID_navi'
 *
 *	-- setFlash.layer() 사용시 방법 - 기본사용방법을 showSWFLayer() 함수로
 *     객체를 감싸주고 메서드호출 시 인자로 Div 아이디 값을 넘겨준다.
 *
 *	<script language="javascript" type="Text/JavaScript">
 *		function showSWFLayer( layername) {
 *			var setFlash = new SWFLoader();
 *			setFlash.init( '넓이', '높이', '파일경로', 총 매개변수값);
 *			setFlash.parameter('파람이름','값'); //이미 기본옵션 사용중
 *			setFlash.id('아이디이름'); //예) ID_SWF파일이름
 *			setFlash.layer(layername)  //예) <div id='SWF파일명Layer'></div>
 *			setFlash.show();
 *		}
 *  </script>
 *
 *	<a href="javascript:showSWFLayer('siteMapLayer')">열기</a>
 *
 *	-- 최종 추가수정 내용
 *	url 입력시 "&" 엠퍼센드 기호 --> "&amp;" 자동치환기능 추가
 *
 */

function SWFLoader() {
	var obj = new String;
	var parameter = new String;
	var embed = new String;

	var classId = new String;
    var codeBase = new String;
	var pluginSpage = new String;
	var embedType = new String;
	var allParameter = new String;

	var src = new String;
	var width = new String;
	var height = new String;
	var id = new String;
	var layer = new String;
	var arg = new String;
	var altText = new String;
	var wmode = new String;

	this.init = function ( w, h, s, a ) {
		width = w; //넓이
		height = h; //높이
		src = s; //파일경로
		arg = String(a).replace(/\&/gi, '%26'); // 매개변수

		wmode = 'transparent'; //모드설정

		classId = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
		codeBase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
		pluginSpage = 'http://www.macromedia.com/go/getflashplayer';
		embedType = 'application/x-shockwave-flash';

		parameter += "<param name='allowScriptAccess' value='always'>\n";
		parameter += "<param name='allowFullScreen' value='false'\n>";
		parameter += "<param name='movie' value='"+ s + "'>\n";
		parameter += "<param name='quality' value='high'>\n";
		parameter += "<param name='base' value='.'>\n";
		parameter += "<param name=FlashVars value='arg="+arg+"'>\n";
	}

	//플래시 오브젝트 옵션설정
	this.parameter = function ( param, value ) {
		 parameter += "<param name='"+param +"' value='"+ value + "'>\n";
	}

	// 플래시 wmode 설정 setFlash.wmode('window')
	this.wmode = function ( value ) {
		wmode = value;
	}

	// 플래시 아이디 설정
	this.id = function ( value ) {
		id = value;
	}

	// 플래시 대체텍스트 설정
	this.alt = function ( value ) {
		altText = value;
	}

	// 플래시 삽입 레이어 설정
	this.layer = function ( value ) {
		if(value == undefined) {
			layer = "";
		} else {
			layer = value;
		}
	}

	this.show = function () {
		obj = '<object id="'+id+'" width="'+width+'" height="'+height+'" classid="'+classId+'" codebase="'+codeBase+'">\n'+
			parameter +
			'<param name="wmode" value="'+wmode+'">\n'+
			'<!--[if !IE]>-->\n' +
			'<object type="application/x-shockwave-flash" data="' + src + '" width="' + width + '" height="' + height + '" name="' + id + '">\n' +
				parameter +
				'<param name="wmode" value="'+wmode+'">\n'+
			'<!--<![endif]-->\n' +
				'<div class="alt-content alt-' + id + '">' + altText + '</div>\n' +
			'<!--[if !IE]>-->\n' +
			'</object>\n' +
			'<!--<![endif]-->\n' +
		'</object>';

		if(layer == "") {
			document.write(obj);
		}else{
			var div = document.getElementById( layer);
			div.style.display = "";
			div.innerHTML = obj;
		}
	}
}

function hideSWFLayer(div) {
	var div = document.getElementById( div);
	div.style.display = "none";
	div.innerHTML = "";
}

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	}
	else {
		return document[movieName];
	}
 }


//============================== 매장안내 관련 함수
//기존 콜백함수를 변경
function callExternalInterface(movieId, param1, param2) {
    thisMovie(movieId).moveMc( param1, param2 );
}

/*
// 리스트 제어
function showMapList( param ) {
	//alert("1");
	document.getElementById("store_viewWrap").style.display = "none";
	document.getElementById("store_listWrap").style.display = "";
	//alert( param );
}

// 뷰 제어
function showMapDetailList( param1, param2 ) {
	//alert("2");
	document.getElementById("store_viewWrap").style.display = "";
	document.getElementById("store_listWrap").style.display = "none";
	//alert( param1+", "+param2 );
}

// 닫기
function hideMapListLayer() {
	//alert("3");
	document.getElementById("store_viewWrap").style.display = "none";
	document.getElementById("store_listWrap").style.display = "none";
	//alert("매장리스트 레이어 숨기기");
}
*/
//------------------- SWF 제어함수 끝



// top sitemap layer (height - 0/100%)
function sitmapLayer() {
	var target = document.getElementById('top-sitemap');
	target.className = (target.className=='' ? 'top-sitemap-open':'');
}

// main select layer
function srchLayer() { document.getElementById('srchLayerList').className = 'selectlayer-box-open'; }
function srchLayerHide() { document.getElementById('srchLayerList').className = 'selectlayer-box'; }

// familysite
function famlistAction() {
	var target = document.getElementById('familyList');
	target.style.display = (target.style.display=='block' ? 'none':'block');
}

// popup
function popup(Fn,Win, X, Y, Scroll){
	var l = (screen.width) ?	(screen.width- X) / 2	: 0;
	var t = (screen.height) ?	(screen.height- Y) / 2 : 0;
	var NewWindow=window.open(Fn,Win,'width='+X+',height='+Y+',top='+t+',left='+l+',scrollbars='+Scroll+'');
	NewWindow.focus();
}

// popup2
function popupM(Fn,Win,top,X,Y,Scroll,resize){
	var rsiz = resize;
	if(rsiz == '') {
		rsiz = 0;
	}
	else {
		rsiz = 1;
	}
	NewWindow=window.open(Fn,Win,'width='+X+',height='+Y+',top=0,left=0,scrollbars='+Scroll+',toolbar=no,location=no,directories=no,status=no,resizable=' + rsiz + ',menubar=no');
}

//제품바로가기
function goToProduct(prdCd) {
	if(prdCd.replace(/ /gi, '') == '') { alert('제품코드가 없습니다.');return; }
	window.location.href = "/product.do?method=view&prdCd="+prdCd;
}

// 링크 바로가기
function listgo(e) {
opener.top.location= e;
self.close();
}

/* div사이즈 조절 */
function div_control(e) {
 if(e=="on") {
  document.getElementById("fbanner").className = "on";
 }
 else {
  document.getElementById("fbanner").className = "off";
 }
}

/* main notice 레이어 조절 */
function notice(e) {
	if(e=="on") {
		document.getElementById("notice").style.display = "none";
		document.getElementById("notice_on").style.display ="";
	}
	else {
		document.getElementById("notice").style.display = "";
		document.getElementById("notice_on").style.display = "none";
	}
}

/* top navi 조절 */
function flashTopNaviOn(e) {
	var div = document.getElementById("gnb");
	if(e) {
		div.style.height = '240px';
	}
	else {
		div.style.height = '65px';
	}
}

/* layer popup 열고 닫기 */
function show(object) {
 var div = document.getElementById(object);
 if(div) div.style.display = 'block';
}
function hide(object) {
 var div = document.getElementById(object);
 if(div) div.style.display = 'none';
}

function toggle(object) {
 var div = document.getElementById(object);
 if(div.style.display == 'none') div.style.display = 'block';
 else div.style.display = 'none';
}

/* div 코딩 세로 정렬 */
function vAlign() {
 objs = document.getElementsByTagName('DIV');
 for (var i = 0 ; i < objs.length ; i++ )
 {
  if (objs[i].className == "vAlign")
   objs[i].style.marginTop = Math.floor(parseInt(objs[i].parentNode.offsetHeight - objs[i].offsetHeight) / 2)+"px";
 }
}
window.onload = vAlign;


// 고양이 클릭시 낮과 밤 바꾸기 ---------------------------------------------------------//
function bg_change() {
	if(document.getElementById("containerBg").className == "") {
		document.getElementById("containerBg").className = "night";
		document.getElementById("hot01").src="/images/common/hot_menu01_n.png";
		document.getElementById("hot02").src="/images/common/hot_menu02_n.png";
		document.getElementById("hot03").src="/images/common/hot_menu03_n.png";
		document.getElementById("static01").src="/images/common/static_menu01_n.png";
		document.getElementById("static02").src="/images/common/static_menu02_n.png";
		document.getElementById("static03").src="/images/common/static_menu03_n.png";
		document.getElementById("static04").src="/images/common/static_menu04_n.png";
		document.getElementById("static05").src="/images/common/static_menu05_n.png";
		document.getElementById("static06").src="/images/common/static_menu06_n.png";
		document.getElementById("static07").src="/images/common/static_menu07_n.png";
}
	else {
	document.getElementById("containerBg").className = "";
		document.getElementById("hot01").src="/images/common/hot_menu01.png";
		document.getElementById("hot02").src="/images/common/hot_menu02.png";
		document.getElementById("hot03").src="/images/common/hot_menu03.png";
		document.getElementById("static01").src="/images/common/static_menu01.png";
		document.getElementById("static02").src="/images/common/static_menu02.png";
		document.getElementById("static03").src="/images/common/static_menu03.png";
		document.getElementById("static04").src="/images/common/static_menu04.png";
		document.getElementById("static05").src="/images/common/static_menu05.png";
		document.getElementById("static06").src="/images/common/static_menu06.png";
		document.getElementById("static07").src="/images/common/static_menu07.png";
	}
}

function MOVLoader() {
	var embed = new String();
	var width = new String();
	var height = new String();
	var src = new String();
	var parameter = new String();

	this.init = function( w, h, s ) {
		width = w;
		height = h;
		src = s;
	}
	this.parameter = function( param, value ) {

	}
	this.show = function() {
		embed = '<embed TYPE="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/mediaplayer/en/download/Win32IE4x86.asp"'+
				'filename="'+src+'"'+
				'Name="Vod Player"'+
				'ShowControls="0"'+
				'AutoStart="true"'+
				'ShowDisplay="0"'+
				'ShowPositionControls="1"'+
				'ShowTracker="1"'+
				'autoresize="1"'+
				'ShowStatusBar="0"'+
				'ClickToPlay="1"'+
				'EnableFullScreenControls="1"'+
				'SendKeyboardEvents="1"'+
				'volume="100%"'+
				'sendMouseClickEvents="1"'+
				'SendMouseMoveEvents="1"'+
				'width="'+width+'"'+
				'height="'+height+'"'+
				'windowlessVideo="1"'+
				'loop="true">'+
				'</embed>';
		document.write(embed);
	}
}

// 미니가이드 열기
 function viewMiniGuide() {
  var popupWindow = window.open('/utility/miniGuide.jsp','miniGuide','width=980, height=600');void(0);
  popupWindow.focus();
 }

 // 미니가이드 링크 이동
 function miniGuideLink(link) {
  try
  {
   opener.document.location.href = link;
   opener.document.focus();
  }
  catch (e)
  {
   window.open(link)
  }
 }

  //설문조사 팝업
function storeResearch() {

	$.ajax({
		url:"/common/isFrontLoginCheck.jsp",
		type:"post",
		success:function(data, resStat) {
			if(trim(data) == '00') {
				popup('/storeResearch.do?method=insertForm', '', '555', '765');
			}
			else {
				location.href = '/login.do?method=loginForm';
			}
		}
	});
}

/* line-- */
// 쇼핑몰
function jsNoticeTog(idx,e){
	if(isAccess(e)){
		for(var i=1; i<=6; i++){
			var objD = document.getElementById("content"+i);
			var jsTogBg = document.getElementById("MRightLinePrd");
			
			var jsTogImg = document.getElementById("MRightLineTab"+i);
			if(i==idx){
				objD.style.display = "block";
				jsTogImg.src = jsTogImg.src.replace("off","on");
				jsTogBg.className = "MRightLineBg" + i;
			}
			else{
				objD.style.display = "none";
				jsTogImg.src = jsTogImg.src.replace("on","off");
			}
		}
		return false;
	}
}

// 브랜드
function jsNoticeTog2(idx,e){
	if(isAccess(e)){
		for(var i=1; i<=6; i++){
			var objD = document.getElementById("content"+i);
			var jsTogBg = document.getElementById("new_MRightLinePrd");
			
			var jsTogImg = document.getElementById("new_MRightLineTab"+i);
			if(i==idx){
				objD.style.display = "block";
				jsTogImg.src = jsTogImg.src.replace("off","on");
				jsTogBg.className = "new_MRightLineBg" + i;
			}
			else{
				objD.style.display = "none";
				jsTogImg.src = jsTogImg.src.replace("on","off");
			}
		}
		return false;
	}
}

function isAccess(e) {

	var keynum;
	var ismouseClick = 1;

	if (window.event) { //IE & Safari
		keynum = e.keyCode;	

		//Safari의 경우 마우스클릭은 keynum 0 이 넘어옴
		if (keynum == 0){
			ismouseClick = 0;
		}		
	}
	else if ( e.which ){ // Netscape/Firefox/Opera
		keynum = e.which;
		
		if (keynum == 1) {
			ismouseClick = 0;
		}		
	}
	
	//마우스 클릭이거나 엔터키를 누른경우 true값 반환
	if ( ismouseClick == 0 || keynum == 13 ) {		
		return true;
	}
	else{
		return false;
	}
}
/* --line */


/*
@ 설명 : 외부개발자용
*/

function embedFlash( width, height, dir, param) {
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+width+"' height='"+height+"'>");
	document.write("<param name='allowScriptAccess' value='always'>");
	document.write("<param name='allowFullScreen' value='false'>");
	document.write("<param name='movie' value='"+dir+"'>");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='wmode' value='transparent'>");
	document.write("<param name='base' value='.'>");
	document.write("<param name=FlashVars value='"+param+"' />");
	document.write("<embed base='.' src='"+dir+"' name='wmode' value='transparent' FlashVars='"+param+"' quality='high' width='"+width+"' height='"+height+"' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' name='wmode' value='transparent' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>");
	document.write("</object>");
}