
/************************************************************
* Link Blur Script 시작 -- 링크 점선 테두리 없애기 **** 적용페이지 body 에 onload="allblur()" 추가.
************************************************************/

//이미지 클릭시 점선 없애기
var myAnchors=document.all.tags("A"); 
function allblur() {
	for (i=0;i<myAnchors.length;i++) { 
		myAnchors[i].onfocus=new Function("myAnchors["+i+"].blur()");
	} 
}

/************************************************************
* Link Blur Script 끝
************************************************************/



// IMAGE_ROLLOVER 스크립트 

function menuOn(imgEl)
{
	if(imgEl.bchoice != "true" )
	{
		imgEl.src = imgEl.src.replace(".gif", "_.gif");
	}
}

function menuOut(imgEl)
{
	if(imgEl.bchoice != "true" )
	{
		imgEl.src = imgEl.src.replace("_.gif", ".gif");
	}
}




///플래쉬 구현///////////////////////////////////////////
// s	: url
// d	: flash id
// w	: source width
// h	: source height
// t	: wmode ("" for none, transparent, opaque ...)
/////////////////////////////////////////////////////////
function mf_direct(s,d,w,h,t, url){
 return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"  codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width="+w+" height="+h+" id="+d+"> "
  + " <param name=wmode value="+t+" /> "
  + " <param name=movie value="+s+" />" 
  + " <param name=quality value=high /> "
  + " <param name=FlashVars value='path=" + url + "' /> "
  + " <embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+">"
  + " </embed></object>";
}

function mf(s,d,w,h,t, url){
 return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"  codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width="+w+" height="+h+" id="+d+"> "
  + " <param name=wmode value="+t+" /> "
  + " <param name=movie value="+Flash_File(s)+" />" 
  + " <param name=quality value=high /> "
  + " <param name=FlashVars value='xmlURL=" + Xml_File(url) + "' /> "
  + " <embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+">"
  + " </embed></object>";
}

function mn(s,d,w,h,t){
 return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"  codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width="+w+" height="+h+" id="+d+"> "
  + " <param name=wmode value="+t+" /> "
  + " <param name=movie value="+s+" />" 
  + " <param name=quality value=high /> "
  + " <embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+">"
  + " </embed></object>";
}

function Flash_File(src)
{
	var return_str;
	switch(src)
	{
		case "P_Top_Flash":		//프리미엄-상단
			//return_str = "../Flash/TopRolling.swf";
			return_str = "../Flash/TopRolling03.swf";
			break;
		case "P_Detail_Flash":	//프리미엄-상세
			return_str = "../Flash/BestItem74.swf";
			break;
		case "R_Top_Flash":		//브랜드-상단
			return_str = "../Flash/TopRolling.swf";
			//return_str = "../Flash/TopRolling03.swf";
			break;
		case "R_Detail_Flash":	//브랜드-상세
			return_str = "../Flash/BestItem54.swf";
			break;
		case "R_BestChoice_Flash":	 //브랜드-베스트초이스
			return_str = "../Flash/BestItemChoiceBrand.swf";
			break;
		case "D_Top_Flash":		//용품-상단
			return_str = "../Flash/TopRolling02.swf";
			break;
		case "D_Detail_Flash":	//용품-상세
			return_str = "../Flash/BestItem84.swf";
			break;
		case "D_Best5_Flash":	//용품-베스트5
			return_str = "../Flash/Best5.swf";
			break;
		case "D_Vote_Flash":		//용품-추천
			return_str = "../Flash/BoriVote01.swf";
			break;
		case "D_Left_Flash":		//용품-왼쪽메뉴
			return_str = "../Flash/Navi.swf?domain_name=../Flash/";
			break;
		case "Main_Menu_Flash":		//메인 메뉴
			return_str = "../Flash/top_menu.swf?Mmenu=1";
			break;
		default: 
			return_str = src;
			break;
	}
	return return_str;
}

function Xml_File(src)
{
	var return_str;
	switch(src)
	{
		case "P_Top_Xml":		//프리미엄-상단
			return_str = "../Xml/TopRolling03.xml";
			break;
		case "P_Detail_Xml":	//프리미엄-상세
//			return_str = "../Asp/BestItem74.asp";			
			return_str = "../sample_xml/Best_Item_Xsl_Load.asp?BrdCd=2";			
			break;
		case "R_Top_Xml":		//브랜드-상단
			return_str = "../Xml/TopRolling.xml";
			break;
		case "R_Detail_Xml":	//브랜드-상세
			return_str = "../Xml/BestItem54.xml";	
			break;
		case "R_BestChoice_Xml":	 //브랜드-베스트초이스
			//return_str = "../Xml/BestItemChoiceBrand.xml";
			return_str = "../Xml/BestChoice_R.xml";
			break;
		case "D_Top_Xml":		//용품-상단
			return_str = "../Xml/TopRolling02.xml";
			break;
		case "D_Detail_Xml":	//용품-상세
			return_str = "../Xml/BestItem84.xml";
			break;
		case "D_Best5_Xml":	//용품-베스트5
			return_str = "../Xml/Best5.xml";
			break;
		case "D_Vote_Xml":		//용품-추천
			return_str = "../Xml/Item_Recommend.xml";
			break;
		case "D_Left_Xml":		//용품-왼쪽메뉴
			return_str = "../Xml/Link.xml";
			break;
		case "Main_Menu_Xml":		//용품-왼쪽메뉴
			return_str = "../Xml/topNavigation.xml";
			break;
		default: 
			return_str = src;
			break;
	}
	return return_str;
}

function mf2(s,d,w,h,t){
 return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"  codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width="+w+" height="+h+" id="+d+"> "
  + " <param name=wmode value="+t+" /> "
  + " <param name=movie value="+s+" />" 
  + " <param name=quality value=high /> "
  + " <embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+">"
  + " </embed></object>";
}

function mn(s,d,w,h,t){
 return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"  codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width="+w+" height="+h+" id="+d+"> "
  + " <param name=wmode value="+t+" /> "
  + " <param name=movie value="+s+" />" 
  + " <param name=quality value=high /> "
  + " <embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+">"
  + " </embed></object>";
}

// write document contents
function documentwrite(src){
	document.write(src);
}
/////////////////////////////////////////////////////////

//이전 common.js 추가

// 창의 크기를 조절합니다.
// 일반적인 OS와는 달리 XP에 따른 창크기 문제로 인하여 작성된 것임.
function WindowsResizeTo(width, height)
{
	var ua = window.navigator.userAgent;
	var msie = ua.indexOf ( "MSIE" );
	var msxp = ua.indexOf ( "Windows NT 5.1" );
	var msxpsp2 = ua.indexOf ( " SV1" );	//서비스팩 2번을 설치한 경우

	if(msie >0 && msxp >0 && msxpsp2 >0)
	{
		window.resizeTo(width, height + 22);			
	}
	else
	{
		window.resizeTo(width, height);	
	}

}

// 문자 뒤의 공백문자를 제거하는 함수
function rTrim ( str ) {
	str = str + "";
	var len = str.length;

	for(var i = (len - 1); (str.charAt(i) == ' '); i--);
		str = str.substring(0, i + 1);

	return str;
}

// 문자 맨 앞의 공백문자를 제거하는 함수
function lTrim ( str ) {
	var len = str.length;
	var i = 0;

	for(i = 0; str.charAt(i) == ' '; i++);
		str = str.substring(i, len);

	return str;
}

//전체 공백을 제거합니다.
function Trim ( strValue ) {
	strValue = lTrim(rTrim(strValue));
	return strValue;	
}


// 메뉴관련
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
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) 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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
