// JavaScript Document
// flash(파일경로, 가로, 세로, 아이디, 배경색, 변수윈도우모드(transparent, opaque), 보안사항(sameDomain, always))
function flash(url,w,h,id,bg,vars,win,allow){

 // flash define
 var flashStr=
 "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
 "<param name='allowScriptAccess' value='"+allow+"' />"+
 "<param name='movie' value='"+url+"' />"+
 "<param name='FlashVars' value='"+vars+"' />"+
 "<param name='wmode' value='"+win+"' />"+
 "<param name='menu' value='false' />"+
 "<param name='quality' value='high' />"+
 "<param name='bgcolor' value='"+bg+"' />"+
 "<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='"+allow+"' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
 "</object>";

 // flash print
 document.write(flashStr);
}


/* Scrap */
function copySource(con){
	var url = "";

	if (con == 1)
	{
		url = "http://www.prompt.co.kr/sskin/flash/intro_player.swf";
	}
	
	// flash define
	 var flashStr=
	 "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='832' height='468' id='flashobj' align='middle'>"+
	 "<param name='allowScriptAccess' value='always' />"+
	 "<param name='movie' value='"+url+"' />"+
	 "<param name='wmode' value='opaque' />"+
	 "<param name='menu' value='false' />"+
	 "<param name='quality' value='high' />"+
	 "<embed src='"+url+"' wmode='opaque' menu='false' quality='high' width='832' height='468' name='flashobj' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	 "</object>";
 
	//Only IE
	var appname = navigator.appName;
	if(appname == "Microsoft Internet Explorer") { window.clipboardData.setData('Text',flashStr); alert('Copy html source complete.'); }

}

function copyLink(con){ 

	var url = "";

	if (con == 1)
	{
		url = "http://www.prompt.co.kr/sskin/flash/intro_player.swf";
	}

	var linkStr = url;

	//Only IE
	var appname = navigator.appName;
	if(appname == "Microsoft Internet Explorer") { window.clipboardData.setData('Text',linkStr); alert('Copy URL complete.'); }

}


function introDone(){ 
	location.href = "home.html";
}


/* insertAfter Method */
function insertAfter(newElement,targetElement){
	var parent = targetElement.parentNode;
	if (parent.lastchild == targetElement)
	{
		parent.appendChild(newElement);
	} else {
		parent.insertBefore(newElement,targetElement.nextSibling);
	}
}

/* Content Box Bg Effect */
function contentbg(){
	if (document.getElementById("content_wrap"))
	{
		var conbox_mid = document.getElementById("content_wrap");
		var conbox_top = document.createElement("div");
		var conbox_btm = document.createElement("div");
		conbox_top.setAttribute("id","conbox_top");
		conbox_btm.setAttribute("id","conbox_btm");
		conbox_mid.parentNode.insertBefore(conbox_top,conbox_mid);

		insertAfter(conbox_btm,conbox_mid);
	}
}

/* Product Video Play */
function product_video(d1,d2){
	var path = "/common/flash/flvplayer.swf?FLVpath=/"+d1+"/"+d2+"/"+d2+".flv&amp;flvauto=false";
	flash(path,519,318,'video_swf','','','transparent','sameDomain');
}

/* Change Image Src */
function overImg(img){

	var imgSrc = img.src;
	var splitSrc = imgSrc.split("_off");
	var path1 = splitSrc[0];
	var path2 = splitSrc[1];
	var path = splitSrc[0]+"_on"+splitSrc[1];
	img.src = path;

}

function outImg(img){
	var imgSrc = img.src;
	var splitSrc = imgSrc.split("_on");
	var path1 = splitSrc[0];
	var path2 = splitSrc[1];
	var path = splitSrc[0]+"_off"+splitSrc[1];
	img.src = path;
}

/* Brand Story */
function brandstory(){
 if (document.getElementById("brandstory"))
 {
	var brandstoryObj = document.getElementById("brandstory");
	var imgList = brandstoryObj.getElementsByTagName("img");
	
	//First li Element Padding remove.
	var ulList = brandstoryObj.getElementsByTagName("ul");	
	var liList = new Array;
	for (j=0;j<ulList.length;j++)
	{
		liList[j] = ulList[j].getElementsByTagName("li");
		liList[j][0].style.paddingLeft = "0";
	}
	//

	var borderList = new Array;

	for (i=0;i<imgList.length;i++)
	{
		imgList[i].parentNode.style.position = "relative";
		borderList[i] = document.createElement("div");
		borderList[i].style.width = "155px";
		borderList[i].style.height = "180px";
		borderList[i].style.position = "absolute";
		borderList[i].style.top = "0";
		borderList[i].style.left = "0";

		imgList[i].parentNode.appendChild(borderList[i]);

	}

	if (imgList[0])	{ imgList[0].onmouseover = function(){ showBorder(borderList[0]); } }
	if (imgList[1])	{ imgList[1].onmouseover = function(){ showBorder(borderList[1]); } }
	if (imgList[2])	{ imgList[2].onmouseover = function(){ showBorder(borderList[2]); } }
	if (imgList[3])	{ imgList[3].onmouseover = function(){ showBorder(borderList[3]); } }
	if (imgList[4])	{ imgList[4].onmouseover = function(){ showBorder(borderList[4]); } }
	if (imgList[5])	{ imgList[5].onmouseover = function(){ showBorder(borderList[5]); } }
	if (imgList[6])	{ imgList[6].onmouseover = function(){ showBorder(borderList[6]); } }
	if (imgList[7])	{ imgList[7].onmouseover = function(){ showBorder(borderList[7]); } }
	
	if (borderList[0]) { borderList[0].onmouseover = function(){ showBorder(borderList[0]); } }
	if (borderList[1]) { borderList[1].onmouseover = function(){ showBorder(borderList[1]);	} }
	if (borderList[2]) { borderList[2].onmouseover = function(){ showBorder(borderList[2]);	} }
	if (borderList[3]) { borderList[3].onmouseover = function(){ showBorder(borderList[3]);	} }
	if (borderList[4]) { borderList[4].onmouseover = function(){ showBorder(borderList[4]);	} }
	if (borderList[5]) { borderList[5].onmouseover = function(){ showBorder(borderList[5]);	} }
	if (borderList[6]) { borderList[6].onmouseover = function(){ showBorder(borderList[6]);	} }
	if (borderList[7]) { borderList[7].onmouseover = function(){ showBorder(borderList[7]);	} }

	if (imgList[0])	{ imgList[0].onmouseout = function(){ hideBorder(borderList[0]); } }
	if (imgList[1])	{ imgList[1].onmouseout = function(){ hideBorder(borderList[1]); } }
	if (imgList[2])	{ imgList[2].onmouseout = function(){ hideBorder(borderList[2]); } }
	if (imgList[3])	{ imgList[3].onmouseout = function(){ hideBorder(borderList[3]); } }
	if (imgList[4])	{ imgList[4].onmouseout = function(){ hideBorder(borderList[4]); } }
	if (imgList[5])	{ imgList[5].onmouseout = function(){ hideBorder(borderList[5]); } }
	if (imgList[6])	{ imgList[6].onmouseout = function(){ hideBorder(borderList[6]); } }
	if (imgList[7])	{ imgList[7].onmouseout = function(){ hideBorder(borderList[7]); } }

	if (borderList[0]) { borderList[0].onmouseout = function(){ hideBorder(borderList[0]); } }
	if (borderList[1]) { borderList[1].onmouseout = function(){ hideBorder(borderList[1]);	} }
	if (borderList[2]) { borderList[2].onmouseout = function(){ hideBorder(borderList[2]);	} }
	if (borderList[3]) { borderList[3].onmouseout = function(){ hideBorder(borderList[3]);	} }
	if (borderList[4]) { borderList[4].onmouseout = function(){ hideBorder(borderList[4]);	} }
	if (borderList[5]) { borderList[5].onmouseout = function(){ hideBorder(borderList[5]);	} }
	if (borderList[6]) { borderList[6].onmouseout = function(){ hideBorder(borderList[6]);	} }
	if (borderList[7]) { borderList[7].onmouseout = function(){ hideBorder(borderList[7]);	} }
	
	function showBorder(borderObj){
		borderObj.style.border = "6px solid #ff9000";
	}

	function hideBorder(borderObj){
		borderObj.style.border = "none";
	}
 }

}

/* Link Focus Hide */
function hideFocus(){
 var Links = document.getElementsByTagName("a");
 for (t=0;t<Links.length;t++)
 {
	 Links[t].onmousedown = function(){
		 this.hideFocus = true;
	 }
 }
}

window.onload = hideFocus;

