// ÇÃ·¡½Ã ¸µÅ© 
function render_flash(swf_name,swf_width,swf_height){
	var text ='';
	text ='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+swf_width+'" height="'+swf_height+'">';
	text +='<param name="movie" value="'+swf_name+'">';
	text +='<param name="allowScriptAccess" value="always">';
	text +='<param name="quality" value="high">';
	text +='<embed src="'+swf_name+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+swf_width+'" height="'+swf_height+'">';
	text +='<param name="wmode" value="transparent">';
    	text +='</embed>';
	text +='</object>';
	document.write(text);
}

function calc_length(str) {
	var len = str.length;
	for (i = 0; i < str.length; i++)
		if (str.charCodeAt(i) > 127 && navigator.appVersion.indexOf("MSIE") != -1)
			len++;
	return len;
}

// FAQ Å¬¸¯ ½ºÅ©¸³Æ®
function InfoFaq01View(obj){
	for(i=0;i<document.all.popLayer01.length;i++)
	{
		if(i == obj) {
		if(document.all.popLayer01[i].style.display == "block") {				
				document.all.popLayer01[i].style.display = "none";
			} else {
				document.all.popLayer01[i].style.display = "block";
			}			
		} else {
			document.all.popLayer01[i].style.display = "none";
		}		
	}
}

function InfoFaq01View2(obj){
	for(i=0;i<document.all.popLayer02.length;i++)
	{
		if(i == obj) {
		if(document.all.popLayer02[i].style.display == "block") {				
				document.all.popLayer02[i].style.display = "none";
			} else {
				document.all.popLayer02[i].style.display = "block";
			}			
		}		
	}
}

/*################# e-Book Image Rollover Summary #################*/

function showDiv(el) {
	var target_el = document.getElementById("summary_layer" + el);
	if(target_el) 
		target_el.style.display = "block";
}
function hideDiv(el) {
	var target_el = document.getElementById("summary_layer" + el);
	if(target_el) 
		target_el.style.display = "none";
}

function eventLink1(){
	location.href='/event/20081121/event.jsp';
}
function eventLink2(){
	location.href='/happy/culmaketing/movie_date_01.jsp';
}
function eventLink3(){
	location.href='/event/20081013/event.jsp';
}
function eventLink4(){
	location.href='/allicard/nomal_card_20.jsp';
}

function getCookie(cookieName){
  var cookieValue = document.cookie;
  var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");
  if(cookieStartsAt == -1){
    cookieStartsAt = cookieValue.indexOf(cookieName + "=");
  }

  if(cookieStartsAt == -1){
    cookieValue = null;
  }else{
    cookieStartsAt = cookieValue.indexOf("=", cookieStartsAt)+1;
    var cookieEndsAt = cookieValue.indexOf(";", cookieStartsAt);
    if(cookieEndsAt == -1){
      cookieEndsAt = cookieValue.length;
    }
    cookieValue = unescape(cookieValue.substring(cookieStartsAt, cookieEndsAt));
  }

  return cookieValue;
}

function _gotopage(idx){
	var nUrl;
	switch(idx){
		case 1:	
			location.href='/custom/member/member_modify.jsp';
			return;
		break;
		case 2:
			window.open('/RIA/pop_insupolicy.jsp','inswin','width=600,height=400,scrollbars=yes');
		break;
		case 3:
			alert('ÁØºñÁßÀÔ´Ï´Ù.');
			return;
		break;
		case 4:
			alert('ÁØºñÁßÀÔ´Ï´Ù.');
			return;
		break;
	}
}

//ÁÖÀ¯¼Ò Ã£±â ÆË¾÷
function _aboutstation(){
	var winflag, nUrl = 'pop_card_01.jsp';
	winflag = window.open(nUrl, 'stationwin','width=100,height=100,scrollbars=no');
	if(!winflag){
		alert('ÆË¾÷ÀÌ Â÷´ÜµÇ¾îÀÖ½À´Ï´Ù.\n\n»çÀÌÆ®ÀÇ ¿øÈ°ÇÑ ÀÌ¿ëÀ» À§ÇØ¼­ ÆË¾÷À» Çã¿ëÇØÁÖ¼¼¿ä.');
		return;
	}
}

//º§¼Ò¸® ÆË¾÷
function _popupbell(){
	window.open('http://211.171.202.206/soil1renew/sendBell.php', 'bwin','width=100,height=100');
}


//ºñÁî¸µ ÆË¾÷
function _popupring(){
	window.open('http://211.171.202.206/bizring/join2.php', 'ring','width=100,height=100');
}

function _aboutbonuscard(){
	var nUrl = '/allicard/pop_bonuscard.jsp';
	window.open(nUrl, 'pwin','width=100,height=100');
}

//ÅÚÄÚÀÎÆË¾÷È£ÃâÇÏ±â
function _telcoin(boollogin){
	var nUrl = 'http://telcoin.s-oilbonus.com/input.jsp';
	var cur_url = document.location.href;
	var ans;
	if(boollogin){
		window.open(nUrl,'telwin','width=,height=');
	}
	else{
		if(ans=confirm('·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½ºÀÔ´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?')){
			location.href='/custom/member/login.jsp?redirect='+cur_url;
		}
		else{
			return;
		}
	}
}

//5sÀÌº¥Æ®
function _5sEvent(countval, pagetype){
	var nUrl = '/event/20070713/5s/5s_proc.jsp?idx='+countval+'&pagetype='+pagetype;
	window.open(nUrl,'5swin','width=100,height=100');
}

//eBookº¸±â
function case_eBook(){
	window.open('http://www.s-oilbonus.com/happy/fillingservice/case_eBook/soil.htm','name','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=1014, height=711, top=0, left=0');
}

// ÁÖÀ¯¼Ò ¸Ê ÆË¾÷ 
function mapPop(code){
	window.open ('/allicard/map/index.jsp?code='+code, '', '');
}

// CM¼Û ÆË¾÷ 
function cm_popup(){
	var winflag, nUrl = '/allicard/cm_popup/cm_popup.html';
	winflag = window.open(nUrl, 'cmpopup','width=400,height=200,scrollbars=no');
}


//¿©ÇàÁ¤º¸ ¾Ë·µÃ¢
function alertpop()  {
	var str = "¿©ÇàÁ¤º¸ ¼­ºñ½º ÁßÁö ¾È³»\n\n"
		+"2008³â 10¿ù 1ÀÏ 00:00ºÎÅÍ ¼­ºñ½º°¡ Áß´Ü µÇ¿À´Ï\n"
		+"ÀÌ¿ëÇÏ½Ã´Â ºÐµéÀº Âø¿À ¾øÀ¸½Ã±â ¹Ù¶ø´Ï´Ù.\n"
		+"°¨»çÇÕ´Ï´Ù.";
	alert(str);
}