function fn_showfls (strName, strSrc, strWidth, strHeight, strParam){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'\n");
	document.write("		id='"+strName+"_ex' width='"+strWidth+"' height='"+strHeight+"'\n");
	document.write("		codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab'>\n");
	document.write("		<param name='movie' value='"+strSrc+"' />\n");
	document.write("		<param name='quality' value='high' />\n");
	document.write("		<param name='bgcolor' value='#FFFFFF' />\n");
	document.write("		<param name='allowScriptAccess' value='sameDomain' />\n");
	document.write("		<param name='wmode' value='transparent' />\n");
	if(strParam != "")
		document.write("		<param name='flashvars' value='"+strParam+"'/>\n");
	document.write("		<embed src='"+strSrc+"?"+strParam+"' quality='high' bgcolor='#FFFFFF'\n");
	document.write("			width="+strWidth+"' height='"+strHeight+"' id='"+strName+"' align='middle'\n");
	document.write("			play='true'\n");
	document.write("			loop='false'\n");
	document.write("			quality='high'\n");
	document.write("			allowScriptAccess='sameDomain'\n");
	document.write("			type='application/x-shockwave-flash'\n");
	document.write("			wmode='transparent'\n");
	document.write("			pluginspage='http://www.adobe.com/go/getflashplayer'>\n");
	document.write("		</embed>\n");
	document.write("</object>\n");
}

var intMaxcnt = 8;

function addRecent(pro_no, pro_name, pro_img, pro_type, pro_copy, category){
	var strProno = getCookie("pro_no");
	var strProname = getCookie("pro_name");
	var strProimg = getCookie("pro_img");
	var strProtype = getCookie("pro_type");
	var strProcopy = getCookie("pro_copy");
	var strCategory = getCookie("category");

	//[2007-12-06]타 국가 제품 삭제관련 추가
	var strSiteCode = getCookie("recently_site");
	

	if(fn_addchk(pro_no)){
		var strTprono = getCookie("pro_no");
		var arrProno = strTprono.split("||");
		if(arrProno.length > intMaxcnt){

			delRecent(arrProno[0]);

			strTprono = getCookie("pro_no");
			arrProno = strTprono.split("||");

			strProno = getCookie("pro_no");
			strProname = getCookie("pro_name");
			strProimg = getCookie("pro_img");
			strProtype = getCookie("pro_type");
			strProcopy = getCookie("pro_copy");
			strCategory = getCookie("category");

			//[2007-12-06]타 국가 제품 삭제관련 추가
			strSiteCode = getCookie("recently_site");

		}

		setCookie("pro_no", strProno + pro_no + "||");
		setCookie("pro_name", strProname + pro_name + "||");
		setCookie("pro_img", strProimg + pro_img + "||");
		setCookie("pro_type", strProtype + pro_type + "||");
		setCookie("pro_copy", strProcopy + pro_copy + "||");
		setCookie("category", strCategory + category + "||");

		//[2007-12-06]타 국가 제품 삭제관련 추가
		setCookie("recently_site", strSiteCode + get_site_code() + "||");
	}
}

function fn_addchk(strProno){
	var strTprono = getCookie("pro_no");
	var arrProno = strTprono.split("||");

	for(i=0; i<arrProno.length-1; i++){
		if(strProno == arrProno[i])
			return false;
	}
	return true;
}

function delAllRecent(pro_no){
	var arrProno = pro_no.split("|");
	for(i=0; i<arrProno.length-1; i++){
		delRecent(arrProno[i]);
	}
}

function delRecent(pro_no){
	var strNprono = "";
	var strNproname = "";
	var strNproimg = "";
	var strNProtype = "";
	var strNProcopy = "";
	var strNCategory = "";

	//[2007-12-06]타 국가 제품 삭제관련 추가
	var strNSiteCode	= "";


	var strTprono = getCookie("pro_no");
	var arrProno = strTprono.split("||");
	var strTproname = getCookie("pro_name");
	var arrProname = strTproname.split("||");
	var strTproimg = getCookie("pro_img");
	var arrProimg = strTproimg.split("||");
	var strTProtype = getCookie("pro_type");
	var arrProtype = strTProtype.split("||");
	var strTProcopy = getCookie("pro_copy");
	var arrProcopy = strTProcopy.split("||");
	var strTCategory = getCookie("category");
	var arrCategory = strTCategory.split("||");

	//[2007-12-06]타 국가 제품 삭제관련 추가
	var strTSiteCode	= getCookie("recently_site");
	var arrSiteCode		= strTSiteCode.split("||");

	for(var i=0; i<arrProno.length-1; i++){
		if(pro_no != arrProno[i]){
			strNprono = strNprono + arrProno[i] + "||";
			strNproname = strNproname + arrProname[i] + "||";
			strNproimg = strNproimg + arrProimg[i] + "||";
			strNProtype = strNProtype + arrProtype[i] + "||";
			strNProcopy = strNProcopy + arrProcopy[i] + "||";
			strNCategory = strNCategory + arrCategory[i] + "||";

			//[2007-12-06]타 국가 제품 삭제관련 추가
			strNSiteCode = strNSiteCode + arrSiteCode[i] + "||";

		}
	}

	setCookie("pro_no", strNprono);
	setCookie("pro_name", strNproname);
	setCookie("pro_img", strNproimg);
	setCookie("pro_type", strNProtype);
	setCookie("pro_copy", strNProcopy);
	setCookie("category", strNCategory);
	
	//[2007-12-06]타 국가 제품 삭제관련 추가
	setCookie("recently_site", strNSiteCode);
}


function fnLocation(strUrl){
	location.href = strUrl;
}


function getCookie(name){
	var nameOfCookie = name + "=";
	var x = 0;
	while( x <= document.cookie.length ){
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) {
				endOfCookie = document.cookie.length;
			}
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
	return "";
}

function setCookie(name, value){
	var argv = setCookie.arguments;
	var argc = setCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) + "; path=/; domain = samsung.com";
	//document.cookie = name + "=" + escape (value) + "; path=/; domain = roll.samsung.com";
	//document.cookie = name + "=" + escape (value) + "; path=/; domain = roll.samsung.com";
}

try{
	//document.domain="samsung.com";
}
catch(e){
}


/*
* [Low Bandwidth] 타 국가의 제품을 삭제
*/
function delDifferentSiteProducts(site_code){

	var strNprono		= "";
	var strNproname		= "";
	var strNproimg		= "";
	var strNProtype		= "";
	var strNProcopy		= "";
	var strNCategory	= "";

	var strNSiteCode	= "";

	var strTprono		= getCookie("pro_no");
	var arrProno		= strTprono.split("||");
	var strTproname		= getCookie("pro_name");
	var arrProname		= strTproname.split("||");
	var strTproimg		= getCookie("pro_img");
	var arrProimg		= strTproimg.split("||");
	var strTProtype		= getCookie("pro_type");
	var arrProtype		= strTProtype.split("||");
	var strTProcopy		= getCookie("pro_copy");
	var arrProcopy		= strTProcopy.split("||");
	var strTCategory	= getCookie("category");
	var arrCategory		= strTCategory.split("||");
	
	var strTSiteCode	= getCookie("recently_site");
	var arrSiteCode		= strTSiteCode.split("||");

	for(var i=0; i<arrProno.length-1; i++){
		if(site_code == arrSiteCode[i]){
			strNprono = strNprono + arrProno[i] + "||";
			strNproname = strNproname + arrProname[i] + "||";
			strNproimg = strNproimg + arrProimg[i] + "||";
			strNProtype = strNProtype + arrProtype[i] + "||";
			strNProcopy = strNProcopy + arrProcopy[i] + "||";
			strNCategory = strNCategory + arrCategory[i] + "||";
			
			strNSiteCode = strNSiteCode + arrSiteCode[i] + "||";
		}
	}

	setCookie("pro_no", strNprono);
	setCookie("pro_name", strNproname);
	setCookie("pro_img", strNproimg);
	setCookie("pro_type", strNProtype);
	setCookie("pro_copy", strNProcopy);
	setCookie("category", strNCategory);

	setCookie("recently_site", strNSiteCode);
}
