// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î[, º¯¼ö][,¹è°æ»ö][,À©µµ¿ì¸ðµå])
function flashWrite(url,w,h,vars,bg,win){
	
	var id=url.split("/")[url.split("/").length-1].split(".")[0]; //id´Â ÆÄÀÏ¸íÀ¸·Î ¼³Á¤
	if(vars==null) vars='';
	if(bg==null) bg='#FFFFFF';
	if(win==null) win='transparent';

	function BrowserCheck() {
	appname = navigator.appName;
	useragent = navigator.userAgent;
	 if(appname == "Microsoft Internet Explorer") appname = "IE";
	 IE55 = (useragent.indexOf('MSIE 5.5')>0);  //5.5 ¹öÀü
	 IE6 = (useragent.indexOf('MSIE 6')>0);     //6.0 ¹öÀü

	 if(appname=="IE" && IE55 || IE6) vars = 'ieVer=6'; //ÀÍ½ºÇÃ·Î·¯ÀÌ¸é¼­ 5.5 or 6.0 ¹öÀüÀÌ¸é...
	 else vars= 'ieVer=7';
	}
	//onload=BrowserCheck;


	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
		flashStr+="			codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'";
		flashStr+="			width='"+w+"'";
		flashStr+="			height='"+h+"'";
		flashStr+="			id='"+id+"'";
		flashStr+="			align='middle'>";

		flashStr+="		<param name='allowFullScreen' value='true' />";
		flashStr+="		<param name='allowScriptAccess' value='always' />";
		flashStr+="		<param name='movie' value='"+url+"' />";
		flashStr+="		<param name='FlashVars' value='"+vars+"' />";
		flashStr+="		<param name='wmode' value='"+win+"' />";
		flashStr+="		<param name='menu' value='false' />";
		flashStr+="		<param name='quality' value='high' />";
		flashStr+="		<param name='bgcolor' value='"+bg+"' />";
		flashStr+="		<param name='base' value='.' />";
		
	
	
		flashStr+="		<embed base='.'src='"+url+"'";
		flashStr+="		       flashVars='"+vars+"'";
		flashStr+="		       wmode='"+win+"'";
		flashStr+="		       menu='false'";
		flashStr+="		       quality='high'";
		flashStr+="		       bgcolor='"+bg+"'";
		flashStr+="		       width='"+w+"'";
		flashStr+="		       height='"+h+"'";
		flashStr+="		       name='"+id+"'";
		flashStr+="		       align='middle'";
		flashStr+="		       allowScriptAccess='always'";
		flashStr+="		       allowFullScreen='true'";
		flashStr+="		       type='application/x-shockwave-flash'";
		flashStr+="		       pluginspage='http://www.macromedia.com/go/getflashplayer' />";
		flashStr+=" </object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}
function resizeWindow()
{
	view_pop();//´çÃ·ÀÚ ¹ßÇ¥ 2009-09-03
	/* ÄíÅ°Ã¼Å©ÈÄ °æ°íÃ¢ ¶ç¿ì±â 2009-07-10*/
		if(getCookie("090807_popup") != null){
							
		}else{
			mainpopFunc();
		}

	if (document.body.clientHeight < 600)
	{
		document.getElementById("container").style.height = "600px";
		document.body.style.overflowY = "scroll";
		document.body.style.overflowX = "hidden";
	}
	else
	{
		document.getElementById("container").style.height = document.body.clientHeight;
		document.body.style.overflowY = "hidden";
		document.body.style.overflowX = "hidden";
	}

	
}

//´çÃ·ÀÚ ¹ßÇ¥ 2009-09-03
function view_pop(){
	var winFocus;
	var w = 500;
	var h = 1200;

	var winl = 0;
	var wint = 100;
	if(getCookie("result") != null){
							
		}else{
			 window.open('pop.html','090807_popup','left='+winl+', top='+wint+', width='+w+', height='+h+',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,toolbars=no');
		}
}

/* ÆË¾÷ - ½ºÅ©·¦ 2ÁÖÂ÷*/
function mainpopFunc()
{

	/*
	var winFocus;
	var w = 300;
	var h = 400;

	var winl = 0;
	var wint = 100;

	 window.open('../090807_popup.html','090807_popup','left='+winl+', top='+wint+', width='+w+', height='+h+',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,toolbars=no');
	 */
}

function loginFunc()
{
//	document.getElementById("login").location.href="login.asp";
	document.login_frm.location.href="login.asp";
	document.getElementById("login").style.display = "block";
	omni("EVENT_LOG-IN");
	nas("/flash_depth4");
	
}

function CloseLogin()
{
	document.getElementById("login").style.display = "none";
}
//ÀÌº¥Æ® ½ºÅ©·¦ Å¬¸¯½Ã
function send_scrap(){
	//	alert('½ºÅ©·¦');
	document.count_frm.location="scrap_count.asp";
	nas('/flash_depth6');
}
//ÀÌº¥Æ® ½ºÅ©·¦ Å¬¸¯½Ã
function send_scrap2(){
	//	alert('½ºÅ©·¦');
	document.count_frm.location="scrap_count.asp";
}

function footerlink(idx)
{
	if (idx==1)
	{
		//alert("¸µÅ©"+idx)
	
		window.open('http://www.gmdaewoo.co.kr/kor/purchase/catalogue_apply.jsp?');
			omni("MAIN_CATALOGUE");
	}
	else if (idx==2)
	{
		//alert("¸µÅ©"+idx)
		
		window.open('http://www.gmdaewoo.co.kr/autocard/index.jsp');
		omni("MAIN_AUTO CARD");
	}
	else if (idx==3)
	{
		//alert("¸µÅ©"+idx)
			
		window.open('http://www.gmdaewoo.co.kr/charmclub/main.jsp');
		omni("MAIN_CHARM CLUB");
	}
	else if(idx==4){
		window.open("http://idc.gmdaewoo.co.kr/gmmcc/gmmcc_to.jsp?carID=tosca&contentsID=brandpage");
	}
	else if(idx==5){
		window.open("http://www.gmdaewoo.co.kr/kor/index.jsp");

	}
}
	 function scrapFunc(idx)
{
	var serverURL = "http://www.toscalove.com/";
	var fileName = ["","man.wmv","woman.wmv","making.wmv","tvcf1.wmv","tvcf2.wmv","urban.wmv"];
	var swidth =["","550","550","550","550","550","320"];
	var sheight =["","275","275","367","379","367","240"]
	//alert("scrap_"+fileName[idx]);
	//	document.down_frm.location="http://diocean.gscdn.com/diocean/tosca_studio_test/swf/wmv/"+fileName[idx];
		var MvCopy= "<embed src='http://diocean.gscdn.com/diocean/tosca_studio_test/swf/wmv/"+fileName[idx]+"' width='"+swidth[idx]+"' height='"+sheight[idx]+"'></emved>";
				window.clipboardData.setData('text',MvCopy);
				alert("HTMLÀÌ º¹»ç µÇ¾ú½À´Ï´Ù."); 
		document.count_frm.location="scrap_count.asp?fname=scrap_"+fileName[idx];
} 
function downFunc(idx)
{
	var fileName = ["","man.zip","woman.zip","making.zip","tvcf1.zip","tvcf2.zip","urban.zip"];
	//alert("down_"+fileName[idx]);
				document.down_frm.location="http://diocean.gscdn.com/diocean/tosca_studio_test/swf/wmv/"+fileName[idx];
				//window.open("http://diocean.gscdn.com/diocean/tosca_studio_test/swf/wmv/"+fileName[idx]);
			document.count_frm.location="scrap_count.asp?fname=down_"+fileName[idx];
}

/* ´çÃ·ÀÚ ¹ßÇ¥ ÆË¾÷ */
function pop_gift_list()
{
	var winFocus;
	var w =517;
	var h = 700;

	var winl = screen.availWidth/2-w/2;
	var wint = screen.availHeight/2-h/2;

	winFocus = window.open('list_01.html','NewWin','left='+winl+', top='+wint+', width='+w+', height='+h+',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,toolbars=no');
	winFocus.focus();
}
/*
function getCookie(uName) { 
    var strCookie = " " + window.document.cookie; 
    var ptrFr = strCookie.indexOf(" " + uName + '='); 

    if (ptrFr != -1) { 
        ptrFr = ptrFr + uName.length + 2; 
        ptrTo = strCookie.indexOf(';', ptrFr); 

        if (ptrTo == -1) { 
            ptrTo = strCookie.length; 
        } 
        return unescape(strCookie.substring(ptrFr, ptrTo)); 
    } else { 
        return ""; 
    } 
} 
*/
  function getCookie(key){
                  var cookie = document.cookie;
                  var first = cookie.indexOf(key + '=');
         
                  // ÄíÅ°°¡ Á¸ÀçÇÏ´Â °æ¿ì 
                  if(first >=0){
                        var str = cookie.substring(first,cookie.length);
                        var last = str.indexOf(';');
          
                         // ¸¶Áö¸·  ÄíÅ°ÀÎ °æ¿ì
                         if(last < 0) last = str.length ;
          
                         // ÄíÅ°  °ªÀ» ¾ò¾î¿Â´Ù. 
                        str = str.substring(0,last).split('=');
          
                        return decodeURIComponent(str[1]);
                  } else {
                        return null;
                  }
         }



