﻿  function checkPopupPage(surl,sname,width,height){
 if( opener != null ){ 
 }else{

  var popupOptions = "left=0, top=0, width="+width+",height="+height+",toolbar=no,status=no,scrollbars=no,resizable=no,menubar=no";

  // MIME로 6.x와 7.0 구분해줘야 함.. 
  var ie7_flag = false;
  ie7_flag = (window.navigator.userAgent.indexOf("MSIE 7") != -1);
  // 팝업으로 열기      
  window.open(surl, sname, popupOptions);
  // opener창 닫아주기
/*
  if (ie7_flag) {
   // IE 7.0
   window.open(surl, '_self', popupOptions).close();
  }else {
   // IE 7.0아님..
   window.opener = self; 
  self.close(); 
  }
*/
  return;
 } 
}

  function checkPopupPage2(surl,sname,width,height){
 if( opener != null ){ 
 }else{

  var popupOptions = "left=0, top=0, width="+width+",height="+height+",toolbar=no,status=no,scrollbars=no,resizable=no,menubar=no";

  // MIME로 6.x와 7.0 구분해줘야 함.. 
  var ie7_flag = false;
  ie7_flag = (window.navigator.userAgent.indexOf("MSIE 7") != -1);
  // 팝업으로 열기      
  window.open(surl, sname, popupOptions);
  // opener창 닫아주기
/*
  if (ie7_flag) {
   // IE 7.0
   window.open(surl, '_self', popupOptions).close();
  }else {
   // IE 7.0아님..
   window.opener = self; 
  self.close(); 
  }
*/
  return;
 } 
}

// 플래쉬에 
function playflash()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="499" height="154">');
	document.write('<param name="movie" value="/img/main/main_center.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	
	document.write('<embed src="/img/main/main_center.swf" wmode="opaque" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="499" height="154">');
	document.write('</object>');

}


function menuflash1()
{
	document.write('<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="518" height="49">');
	document.write('<param name="movie" value="/flash/menu_flash.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	
	document.write(' <embed src="/flash/menu_flash.swf" wmode="opaque" quality="high" width="518" height="49" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	
	document.write('</object>');

}


function menuflash2()
{
	document.write('<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="512" height="53">');
	document.write('<param name="movie" value="/flash/menu_flash_2.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="/flash/menu_flash_2.swf" quality="high" bgcolor="#ffffff" width="512" height="53"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');

}

//2009.3.16
function Logo()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="195" height="69">');
	document.write('<param name="movie" value="/images/swf/logo.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="/images/swf/logo.swf" wmode="opaque" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="195" height="69">');
	document.write('</object>');

}

function MainMenu()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="760" height="45">');
	document.write('<param name="movie" value="/images/swf/main_menu.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="/images/swf/main_menu.swf" wmode="opaque" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="760" height="45">');
	document.write('</object>');

}

function Roll()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="100" height="213">');
	document.write('<param name="movie" value="/images/swf/roll.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="/images/swf/roll.swf" wmode="opaque" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="213">');
	document.write('</object>');

}


function LoginMenu()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="960" height="45">');
	document.write('<param name="movie" value="/images/swf/single_main_menu.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="/images/swf/single_main_menu.swf" wmode="opaque" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="960" height="45">');
	document.write('</object>');

}

function Banner01()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="176" height="95">');
	document.write('<param name="movie" value="/images/swf/banner_01.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="/images/swf/banner_01.swf" wmode="opaque" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="176" height="95">');
	document.write('</object>');

}

function no1()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="688" height="221">');
	document.write('<param name="movie" value="/images/swf/no1.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="/images/swf/no1.swf" wmode="opaque" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="688" height="221">');
	document.write('</object>');

}

function no2()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="688" height="221">');
	document.write('<param name="movie" value="/images/swf/no2.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="/images/swf/no2.swf" wmode="opaque" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="688" height="221">');
	document.write('</object>');

}

function no3()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="688" height="221">');
	document.write('<param name="movie" value="/images/swf/no3.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque">');
	document.write('<embed src="/images/swf/no3.swf" wmode="opaque" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="688" height="221">');
	document.write('</object>');

}


// 플래쉬 메뉴
function myfunc(menu) {
	switch (menu) {
		case "A1" : // 큐파일자료
			location.href='/main.php?page=board' ; break; 
		case "A2" : // 필수유틸
			location.href='/main.php?page=customer_remote' ; break; 
		case "A3" : // 고객센터
			location.href='/main.php?page=customer_faq' ; break; 
		case "A4" : // 이벤트존
			location.href='/main.php?page=event' ; break; 
	} 
}



//플래시 패치

// flash
function ShowFlash(url, width, height){
        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '" VIEWASTEXT>');
        document.write('<param name="movie" value="' + url + '">');
        document.write('<param name="quality" value="high">');
        document.write('<param name="wmode" value="transparent">');
        document.write('<embed src="' + url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
        document.write('</object>');
}


// BUTTON STYLE BETBROWSER
function highlight(obj, isHover)
{

	var color;
	if(isHover)
	{
		color = "";
		obj.style.backgroundColor = "#f4f4f4";
		obj.style.borderColor = "";
		obj.style.cursor="hand";
	}
	else
	{
		color = "";
		obj.style.backgroundColor = "";
		obj.style.borderColor = "";
	}

	obj.style.color = color;					// set color of this element
	var tds = obj.getElementsByTagName("TD");	// and all child TDs
	for(var i=0; i<tds.length; i++)
		tds[i].style.color = color;
}

//자료실 공지사항나오는 부분 롤링처리 관련 소스 091007 CJG 추가
function go_page(page)
{
	
	var cookieuserid;
	cookieuserid = getCookie('userid');

	if(!cookieuserid)
	  {
	   alert(login_available);
	   return;
	  }
	
	location.href="main.php?page="+page;
}

function scroll() {
    this.name = "scroll";
    this.item = new Array();
    this.itemcount = 0;
    this.currentspeed = 0;
    this.scrollspeed = 50;
    this.pausedelay = 1000;
    this.pausemouseover = false;
    this.stop = false;
    this.type = 1;
    this.height = 100;
    this.width = 100;
    this.stopHeight=0;
    this.add =function () {
        var text = arguments[0];
        this.item[this.itemcount] = text;
        this.itemcount = this.itemcount + 1;
    };
    this.start = function () {
        this.display();
        this.currentspeed = this.scrollspeed;
        setTimeout(this.name+'.scroll()',this.currentspeed);
    };
    this.display =function () {
        document.write('<div id="'+this.name+'" style="height:'+this.height+';width:'+this.width+';position:relative;overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
        for(var i = 0; i < this.itemcount; i++) {
            if ( this.type == 1) {
                document.write('<div id="'+this.name+'item'+i+'"style="left:0px;width:'+this.width+';position:absolute;top:'+(this.height*i+1)+'px;">');
                document.write(this.item[i]);
                document.write('</div>');
            }
            else if ( this.type == 2 ) {
                document.write('<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i+1)+'px;width:'+this.width+';position:absolute;top:0px;">');
                document.write(this.item[i]);
                document.write('</div>');
            }
        }
        document.write('</div>');
    };
    this.scroll = function () {
        this.currentspeed = this.scrollspeed;
        if ( !this.stop ) {
            for (i = 0; i < this.itemcount; i++) {
                obj = document.getElementById(this.name+'item'+i).style;
                if ( this.type == 1 ) {
                    obj.top = parseInt(obj.top) - 1;
                    if ( parseInt(obj.top) <= this.height*(-1) ) obj.top = this.height * (this.itemcount-1);
                    if ( parseInt(obj.top) == 0 || ( this.stopHeight > 0 && this.stopHeight - parseInt(obj.top) == 0 ) ) this.currentspeed = this.pausedelay;
                }
                else if ( this.type == 2 ) {
                    obj.left = parseInt(obj.left) - 1;
                    if ( parseInt(obj.left) <= this.left*(-1) ) obj.left = this.left* (this.itemcount-1);
                    if ( parseInt(obj.left) == 0 ) this.currentspeed = this.pausedelay;
                }
            }
        }
        window.setTimeout(this.name+".scroll()",this.currentspeed);
    };
    this.onmouseover = function () {
        if ( this.pausemouseover ) {
            this.stop = true;
        }
    };
    this.onmouseout = function () {
        if ( this.pausemouseover ) {
            this.stop = false;
        }
    };
}
//자료실 공지사항나오는 부분 롤링처리 관련 소스 





// cpc가드


 var cpc_protocol = document.location.protocol || "http:";
 var cpc_script_host = ["//nsc1.cpcguard.com","//vsc1.cpcguard.com"];
 var cpc_script_image = cpc_protocol + cpc_script_host[0] + "/cpcguard.gif?cache=" + (new Date()).getTime();

 function cpcguard_script_bind(i){
  try{
   var _head = document.getElementsByTagName("head")[0] || document.documentElement;
   if(_head){
    var _script = document.createElement("script"); _script.id = "include_cpc_script"; _script.type = "text/javascript"; _script.charset = "utf-8"; _script.async = true; _script.src = (cpc_protocol + cpc_script_host[i] + "/new/cpc_script.js"); 
    _head.appendChild(_script);
   }else{window.setTimeout(arguments.callee(i),500);}
  }catch(e){}
 }
 if(!document.getElementById("include_cpc_script")){document.write("<img src='" + cpc_script_image + "' style='width:1px;height:1px;position:absolute;' onload='cpcguard_script_bind(0)' onerror='cpcguard_script_bind(1)' />");}


