function confirmRe(msg, goURL) { 
  if(confirm(msg) == true) location.href = goURL;
}

function openWindow(strURL,strName,intWidth,intHeight) {
	intX = (screen.width-intWidth)/2;
  intY = (screen.height-intHeight)/2;
	var strOption = "width="+intWidth+",height="+intHeight+",left="+intX+",top="+intY;
	var win = window.open(strURL,strName,strOption);
	win.focus();
}

function openWindow1(strURL,strName,intWidth,intHeight) {
	intX = (screen.width-intWidth)/2;
  intY = (screen.height-intHeight)/2;
	var strOption = "scrollbars=yes,resizable=yes,width="+intWidth+",height="+intHeight+",left="+intX+",top="+intY;
	var win = window.open(strURL,strName,strOption);
	win.focus();
}

function Ivalue1(obj,len,msg) {
  var astr;
  astr = deleteSpace(obj.value);
	if ( astr.length >= len ) return false;
	alert (msg);
	obj.focus();
	return true;
}
function event_alert(msg){
	alert(msg);	
}
function go_page(url){	
	location.href = url;
}


function deleteSpace(str1) {
  var idx, len;
  while(true) {
    idx = str1.indexOf(" ")
    if (idx == -1) break
    len = str1.length
    str1 = str1.substring(0, idx) + str1.substring((idx+1),len)
  }
  return str1;
}

function isImage(url) {
	var ix = url.toLowerCase();
	if ((ix.indexOf('.jpg') != -1) || (ix.indexOf('.jpe') != -1) || (ix.indexOf('.jpeg') != -1) || (ix.indexOf('.gif') != -1)) return true;
	else return false; 
}

function resizeWindow(width1,height1) {
  if (document.all) {
	  var cW = document.body.offsetWidth;
	  var cH = document.body.offsetHeight;
	  window.resizeTo(width1,height1);
	  var barsW = width1 - document.body.offsetWidth;
	  var barsH = height1 - document.body.offsetHeight;
	  var wW = barsW + cW;
	  var wH = barsH + cH;
	  window.resizeTo(wW,wH);
  } else {
	  var wW = window.outerWidth;
	  var wH = window.outerHeight;
  }
  var topW = wW - document.body.clientWidth;
  var topH = wH - document.body.clientHeight;

  reW = width1 + topW;
  reH = height1 + topH;
	mvX = (screen.width-reW)/2;
  mvY = (screen.height-reH)/2;
  window.moveTo(mvX,mvY);
  window.resizeTo(reW,reH);
}


function MM_swapImgRestore() {
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() {
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) {
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() {
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function swf(src,w,h){
 html = '';
 html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="param" width="'+w+'" height="'+h+'">';
 html += '<param name="movie" value="'+src+'">';
 html += '<param name="quality" value="high">';
 html += '<param name="bgcolor" value="#ffffff">';
 html += '<param name="menu" value="false">';
 html += '<param name=wmode value="transparent">';
 html += '<param name="swliveconnect" value="true">';
 html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
 html += '</object>';
 document.write(html);
}
function swf2(src,w,h){
 html = '';
 html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="param" width="'+w+'" height="'+h+'">';
 html += '<param name="movie" value="'+src+'">';
 html += '<param name="quality" value="high">';
 html += '<param name="bgcolor" value="#000000">';
 html += '<param name="menu" value="false">';
 html += '<param name=wmode value="transparent">';
 html += '<param name="swliveconnect" value="true">';
 html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
 html += '</object>';
 document.write(html);
}
function swf3(src,name1,w,h){
 html = '';
 html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="'+name1+'" name="'+name1+'" width="'+w+'" height="'+h+'">';
 html += '<param name="movie" value="'+src+'">';
 html += '<param name="quality" value="high">';
 html += '<param name="bgcolor" value="#ffffff">';
 html += '<param name="menu" value="false">';
 html += '<param name=wmode value="transparent">';
 html += '<param name="swliveconnect" value="true">';
 html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="'+name1+'" name="'+name1+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
 html += '</object>';
 document.write(html);
}


function CtrlV(curse,mate,mc_loveHate_1,mc_loveHate_2,mc_loveHate_3,my_lovehate,pro_sel,w,h)
{
 var url = "http://www.comerce.co.kr/event/";
 var src = 	url+"swf/Moring_road.swf?&curse="+curse+"&mate="+mate+"&mc_loveHate_1="+mc_loveHate_1+"&mc_loveHate_2="+mc_loveHate_2+"&mc_loveHate_3="+mc_loveHate_3+"&my_lovehate="+my_lovehate+"&pro_sel="+pro_sel;
 html = '<div>';
 html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="param" width="'+w+'" height="'+h+'">';
 html += '<param name="movie" value="'+src+'">';
 html += '<param name="quality" value="high">';
 html += '<param name="bgcolor" value="#ffffff">';
 html += '<param name="menu" value="false">';
 html += '<param name=wmode value="transparent">';
 html += '<param name="swliveconnect" value="true">';
 html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
 html += '</object></div>';
	 
 window.clipboardData.setData('Text', html);
 var message ="복사되었습니다.\n\n붙여넣기하시기 바랍니다.";
 alert(message);
}


function p_CtrlV(ch_bg,w,h)
{
 var url = "http://event.nbkorea.com/";
 var src = 	url+"swf/flv_p.swf?&my_flv="+url+ch_bg;
 html = '<div>';
 html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="param" width="'+w+'" height="'+h+'">';
 html += '<param name="movie" value="'+src+'">';
 html += '<param name="quality" value="high">';
 html += '<param name="bgcolor" value="#ffffff">';
 html += '<param name="menu" value="false">';
 html += '<param name=wmode value="transparent">';
 html += '<param name="swliveconnect" value="true">';
 html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
 html += '</object></div>';
	 
 window.clipboardData.setData('Text', html);
 var message ="복사되었습니다.\n\n붙여넣기하시기 바랍니다.";
  alert(message);
}


/*팝업 공통  */
function popup_common(url, pop_name ,pleft, ptop, pwidth, pheight, optMenu, optTool, optScroll, optStatus, optResize)
{

	intX = (screen.width-pwidth)/2;
    intY = (screen.height-pheight)/2;
	pop_option = 'left='+ intX +',top='+ intY +',width='+ pwidth +',height='+ pheight +',toolbar='+ optTool +',menubar='+ optMenu +',status='+ optStatus +',scrollbars='+ optScroll +',resizable='+ optResize
	pop_common = window.open(url, pop_name, pop_option);	
	pop_common.focus();
}

function popup_event_new(){
	var url = '/news_event/event/event_0912/event.asp';
	var pop_name = 'pop_event';
	var pwidth=936;
	var pheight=800;
	var optTool = 'no';
	var optMenu = 'no';
	var optScroll = 'yes';
	var optStatus = 'no';
	var optResize = 'no';
	
	intX = (screen.width-pwidth)/2;
    intY = (screen.height-pheight)/2;
	pop_option = 'left='+ intX +',top='+ intY +',width='+ pwidth +',height='+ pheight +',toolbar='+ optTool +',menubar='+ optMenu +',status='+ optStatus +',scrollbars='+ optScroll +',resizable='+ optResize
	
	pop_common = window.open(url, pop_name, pop_option);	
	pop_common.focus();
}


//self.close후 부모페이지 redirection
function pop_link(url){
 opener.document.location.href=url;
 self.close();
}









