﻿
//플래시출력
function getFlash(id,url,w,h,t,bg){
	var flashOut='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width='+w+' height='+h+' id='+id+'>';
	flashOut+='<param name="movie" value='+url+' />';
	flashOut+='<param name="wmode" value='+t+' />';
	flashOut+='<param name="bgcolor" value='+bg+' />';
	flashOut+='<param name="allowScriptAccess" value="sameDomain" />';
	flashOut+='<param name="quality" value="high" />';
	flashOut+='<param name="menu" value="false" />';
	flashOut+='<embed src='+url+' width='+w+' height='+h+' name='+id+' bgcolor='+bg+' swLiveConnect="true" allowScriptAccess="sameDomain" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	flashOut+='</object>';

	document.write(flashOut);
}

// 페이지 focus blur
function bluring(){
	if (event.srcElement!=null) {
		if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
	}
}
document.onfocusin=bluring;

//레이어 온오프
function layerOnOff(obj){
	var obj=document.getElementById(obj);
	if(obj.style.display=='none'){
		obj.style.display='block';
	}else if(obj.style.display=='block'){
		obj.style.display='none';
	}
}

//팝업 화면 중앙에 띄우기
function Win_pop(newwin,w,h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
if(w=='100%') w=window.availWidth;
winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',resizable=no,scrollbars=no,toolbars=no,status=no,menu=no';
win = window.open(newwin, null, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//탑메뉴


function showtopmenusub(foldername,num,subnum,tem_idx){	
	var nPos,id,url,w,h,t,bg;
	id="topNavi";
	nPos='0'+num+'0'+subnum;
	url="/template/swf/topNavi.swf?tem_idx="+tem_idx+"&nPos="+nPos+"&skinNumber="+foldername;
	w=610;h=62;t="transparent";bg="none";
	var flashOut='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width='+w+' height='+h+' id='+id+'>';
	flashOut+='<param name="movie" value='+url+' />';
	flashOut+='<param name="wmode" value='+t+' />';
	flashOut+='<param name="bgcolor" value='+bg+' />';
	flashOut+='<param name="allowScriptAccess" value="sameDomain" />';
	flashOut+='<param name="quality" value="high" />';
	flashOut+='<param name="menu" value="false" />';
	flashOut+='<embed src='+url+' width='+w+' height='+h+' name='+id+' bgcolor='+bg+' swLiveConnect="true" allowScriptAccess="sameDomain" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	flashOut+='</object>';
	document.getElementById('topmenu').innerHTML=flashOut;
}

//달력 레이어
function openmylayer(btn,layerid){
	var btnx=0;
	var btny=0;
	btn.style.cursor='pointer';
	var layer=document.getElementById(layerid);
	var xpos=getxpos(btn);
	var ypos=getypos(btn);
	layer.style.left=xpos+1;
	layer.style.top=ypos+btn.offsetHeight;
	layer.style.display='block';
	btn.onmouseout=function(){
		layer.style.display='none';
	}
	layer.onmouseover=function(){
		layer.style.display='block';
	}
	layer.onmouseout=function(){
		layer.style.display='none';
	}
	function getxpos(obj){
		if(obj.tagName != "BODY"){
			btnx += obj.offsetLeft;
			getxpos(obj.offsetParent);
		}
		return btnx;
	}
	function getypos(obj){
		if(obj.tagName != "BODY"){
			btny += obj.offsetTop;
			getypos(obj.offsetParent);
		}
		return btny;
	}
	btnx=0;
	btny=0;
}



//퀵배너
function scrollMenu(objid,starttop,bottommargin){
	var obj=document.getElementById(objid);
	var ny=starttop+document.body.scrollTop;
	var mosttop=(document.body.clientHeight+document.body.scrollTop)-(bottommargin+obj.offsetHeight);
	var speed=10;
	if(mosttop<=starttop){
		mosttop=starttop;
		obj.style.top=(obj.offsetTop+((mosttop-obj.offsetTop)/speed))+'px';
	}else if(mosttop>starttop){
		if(document.body.clientHeight<document.body.scrollTop){
			obj.style.top=(obj.offsetTop+((mosttop-obj.offsetTop)/speed))+'px';
		}else{
			obj.style.top=(obj.offsetTop+((ny-obj.offsetTop)/speed))+'px';
		}
	}
	setTimeout("scrollMenu('"+objid+"',"+starttop+","+bottommargin+")",10);
}


function template_select(s)
{


    var frm = document.f;

		if( !validate(frm) ){
			return;
		}
   
   url= s.options[s.selectedIndex].value;
  // var win = window.open(url, '','');

 //   Win_pop2(url,1000,600);
  
  //  window.self.focus();
 var tem_win
 tem_win = window.open(url, 'win1');    
 tem_win.focus();


 

}