
// open popup : User Click
function openPopup(url, winW, winH, scroll, winName)
{
	var setup = "width="+ winW +",height="+winH+",toolbar=no,location=no,status=no,menubar=no,top=10,left=50,scrollbars=" + scroll +",resizable=no";
	if (!winName) winName = "";
	window.open(url, winName, setup);
}
// open popup : Auto Popup
function openDenyPopup(url, winW, winH, scroll, winName)
{
	var setup = "width=" + winW + ",height=" + winH + ",toolbar=no,location=no,status=no,menubar=no,top=20,left=20,scrollbars=" + scroll +",resizable=no";
	if (!winName) winName = "";
	var win = window.open(url, winName, setup);
	if (win == null) alert("Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ½Ê½Ã¿À.");
	else win.focus();
}
//open full screen
function openFullScreen(url){
	var setup = "fullscreen=1,scrollbars=0";
	var win = window.open(url,"popup",setup);
}

//´Ü¼ø ¿ÀÇÂ
function openPage(url){
	var win = window.open(url);
}

// image rollover rollout
function rollover(obj) 
{
	var oImg = document.getElementById(obj);
	var imgSrc = oImg.src;
	oImg.src = imgSrc.replace("off", "on");
}
function rollout(obj) 
{
	var oImg = document.getElementById(obj);
	var imgSrc = oImg.src;
	oImg.src = imgSrc.replace("on", "off");
}
/* Image rollover without ID */
function imgover(img) {
	var image=img.src;
	
	if (image.indexOf('on.gif') < 0) {
		currentUrl=image.substr(0,image.indexOf('off.gif'));
		img.src=currentUrl + "on.gif";
	}
	else {
		currentUrl=image.substr(0,image.indexOf('on.gif'));
		img.src=currentUrl + "off.gif";
	}
} 
// Flash ExternalInterface Return Value
function swfInit(src) {
	var url;
	switch(src) {
		//-- load_url
		case "top_xml" : url = "xml/warrants_stock.xml" ; break;
		case "brand_xml" : url = "xml/gift_brand.xml" ; break;
		case "intro_xml" : url = "xml/gift_intro.xml" ; break;
		//-- etc link
		case "link_faq" : url = "javascript:alert('faq');" ; break;
		case "link_qa" : url = "javascript:alert('qa');" ; break;
		case "link_guide" : url = "javascript:alert('guide');" ; break;
	}
	return url;
}

/*var objectTag = "";
function flashWrite(swf_name,swf_file,swf_width,swf_height) {
	var objectTag = "<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='"+swf_width+"' height='"+swf_height+"' id='"+ swf_name +"' align='middle'><param name='allowScriptAccess' value='always'><param name='movie' value='" + swf_file +"'><param name='quality' value='high'><param name='bgcolor' value='#000000'><embed src='" + swf_file +"' quality='high' bgcolor='#000000' width='"+swf_width+"' height='"+swf_height+"' name='"+ swf_name +"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></object>";
	document.write(objectTag);		
	objectTag = "";
}*/

function set_reserve_date( date ) {
    alert(date);
}

function xmlId() {
	return "030201"
}

//show Flash Object ; 1 (ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå)
function showFlashObject(objID, objSource, objWidth, objHeight, objQuality, objWmode, objBgcolor){
	var pageUrl=self.window.location.href;
	//default value setting
	if (objID=="") objID="ShockwaveFlash1";
	if (objWidth=="") objWidth="0";
	if (objHeight=="") objHeight="0";
	if (objQuality=="") objQuality="high";

	document.writeln('<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="'+objWidth+'" height="'+objHeight+'" id="'+objID+'" align="middle">');
	document.writeln('<param name="movie" value="'+objSource+'" />');
	document.writeln('<param name="allowScriptAccess" value="always" />');
	document.writeln('<param name="menu" value="false" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="bgcolor" value="'+objBgcolor+'" />');
	document.writeln('<param name="wmode" value="'+objWmode+'" />');
	document.writeln('<embed src="'+objSource+'" allowScriptAccess="always" menu="false" quality="high" bgcolor="'+objBgcolor+'" wmode="'+objWmode+'" width="'+objWidth+'" height="'+objHeight+'" name="'+objID+'" id="'+objID+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.writeln('</object>');
}

// ÇÃ·¡½Ã È£Ãâ flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î)
function flashWrite(url,width,height){
	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<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='"+width+"' height='"+height+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always'>"+
	"<param name='movie' value='"+url+"'>"+
	"<param name='menu' value='false'>"+
	"<param name='quality' value='high'>"+
	"<param name='bgcolor' value='#FFFFFF'>"+
	"<param name='wmode' value='transparent'>"+
	"<embed src='"+url+"' menu='false' quality='high' width='"+width+"' height='"+height+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>"+
	"</object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}

//show Media Object ; 1
function showMediaObject(objID, objSource, objWidth, objHeight, autostart, showcontrols){
	//default value setting
	if (objID=="") objID="MovieClip1";
	if (objWidth=="") objWidth="400";
	if (objHeight=="") objHeight="345";
	if (autostart=="") autostart="1";
	if (showcontrols=="") showcontrols="0";
	
	document.writeln('<object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="'+objID+'" width="'+objWidth+'" height="'+objHeight+'">');
	document.writeln('<param name="AutoSize" value="0">');
	document.writeln('<param name="AutoStart" value="'+autostart+'">');
	document.writeln('<param name="AutoRewind" value="true">');
	document.writeln('<param name="ClickToPlay" value="0">');
	document.writeln('<param name="Enabled" value="1">');
	document.writeln('<param name="EnableTracker" value="1">');
	document.writeln('<param name="EnableContextMenu" value="0">');
	document.writeln('<param name="ShowStatusBar" value="0">');
	document.writeln('<param name="ShowControls" value="'+showcontrols+'">');
	document.writeln('<param name="ShowAudioControls" value="'+showcontrols+'">');
	document.writeln('<param name="ShowCaptioning" value="0">');
	document.writeln('<param name="Mute" value="0">');
	document.writeln('<param name="ShowDisplay" value="0">');
	document.writeln('<param name="filename" value="'+objSource+'">');
	document.writeln('<!--[if !IE]>-->');
	document.writeln('	<object type="video/x-ms-wmv" data="'+objSource+'" width="'+objWidth+'" height="'+objHeight+'">');
	document.writeln('	<param name="AutoStart" value="'+autostart+'">');
	document.writeln('	<param name="AutoRewind" value="true">');
	document.writeln('	<param name="Enabled" value="1">');
	document.writeln('	<param name="EnableTracker" value="1">');
	document.writeln('	<param name="EnableContextMenu" value="0">');
	document.writeln('	<param name="ShowStatusBar" value="0">');
	document.writeln('	<param name="ShowControls" value="'+showcontrols+'">');
	document.writeln('	<param name="ShowAudioControls" value="'+showcontrols+'">');
	document.writeln('	<param name="ShowCaptioning" value="0">');
	document.writeln('	<param name="ShowDisplay" value="0">');
	document.writeln('	<param name="url" value="'+objSource+'">');
	document.writeln('	<param name="src" value="'+objSource+'">');	
	document.writeln('	</object>');	
	document.writeln('<!--<![endif]-->');
	document.writeln('</object>');
}

//familysite 
function familysite() {
	var obj = document.getElementById('familysitelist');
	if(obj.style.display != "none") 
		obj.style.display = "none";
	else 
		obj.style.display = "block";
}
//mybrand 
function mybrand() {
	var obj = document.getElementById('mybrandList');
	if(obj.style.display != "none") 
		obj.style.display = "none";
	else 
		obj.style.display = "block";
}
//productInfo 
function productInfo() {
	var obj = document.getElementById('productInfoList');
	if(obj.style.display != "none") 
		obj.style.display = "none";
	else 
		obj.style.display = "block";
}
function selectListView(oSelectList) {
		var oSelectList = document.getElementById(oSelectList);
		if(oSelectList.style.display != "none") 
			oSelectList.style.display = "none";
		else 
			oSelectList.style.display = "block";
	}

// Flash ExternalInterface Return Value
function swfInit(src) {
	var url;
	switch(src) {
		//-- load_url
		case "top_xml" : url = "xml/warrants_stock.xml" ; break;
		case "brand_xml" : url = "xml/gift_brand.xml" ; break;
		case "intro_xml" : url = "xml/gift_intro.xml" ; break;
		//-- etc link
		case "link_faq" : url = "javascript:alert('faq');" ; break;
		case "link_qa" : url = "javascript:alert('qa');" ; break;
		case "link_guide" : url = "javascript:alert('guide');" ; break;
	}
	return url;
}

var objectTag = "";
function flashWrite(swf_name,swf_file,swf_width,swf_height) {
	var objectTag = "<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='"+swf_width+"' height='"+swf_height+"' id='"+ swf_name +"' align='middle'><param name='allowScriptAccess' value='always'><param name='movie' value='" + swf_file +"'><param name='quality' value='high'><param name='bgcolor' value='#000000'><embed src='" + swf_file +"' quality='high' bgcolor='#000000' width='"+swf_width+"' height='"+swf_height+"' name='"+ swf_name +"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></object>";
	document.write(objectTag);		
	objectTag = "";
}

function set_reserve_date( date ) {
    alert(date);
}

function xmlId() {
	return "030201"
}

// ¿Ü±¹ÀÎ µî·Ï¹øÈ£ °Ë»ç
function Check_fgnno(fgnno) {
        var sum=0;
        var odd=0;
        buf = new Array(13);
        for(i=0; i<13; i++) { buf[i]=parseInt(fgnno.charAt(i)); }
        odd = buf[7]*10 + buf[8];
        if(odd%2 != 0) { return false; }
        if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) {
                return false;
        }
        multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
        for(i=0, sum=0; i<12; i++) { sum += (buf[i] *= multipliers[i]); }
        sum = 11 - (sum%11);
        if(sum >= 10) { sum -= 10; }
        sum += 2;
        if(sum >= 10) { sum -= 10; }
        if(sum != buf[12]) { return true }		// Çü½Ä¿¡ ¸ÂÁö ¾ÊÀ»¶§
        return false;							// Çü½Ä¿¡ ¸ÂÀ»¶§
}

function onlyNumber()
{
	if((event.keyCode<48)||(event.keyCode>57))
	event.returnValue = false;
}
