function MM_swapImgRestore() { //v3.0
  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() { //v3.0
  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) { //v4.0
  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() { //v3.0
  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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function global_login_check(thisform)
{
	if ( thisform.user_id.value == '' ) {
		alert(' ¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä. ');
		thisform.user_id.focus();
		return false;
	}
	if ( thisform.user_pass.value == '' ) {
		alert(' ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä. ');
		thisform.user_pass.focus();
		return false;
	}
	return true;
}
function vote(code) {
	if (code == "") {
		alert("½Ã½ºÅÛ ¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù. °ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n¿À·ù ³»¿ë : ¼³¹®Á¶»çÀÇ ÄÚµå°ªÀÌ ¾ø½À´Ï´Ù.\n");
		return;
	}
	var select_val = "";
	for ( i = 0 ; i < document.pollf.check_value.length ; i ++ ) {
		if ( document.pollf.check_value[i].checked ) select_val = document.pollf.check_value[i].value;
	}
	if (select_val == "" ) {
		window.alert("¼³¹®Á¶»çÀÇ Ç×¸ñÀ» ¼±ÅÃÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
		return; 
	}
	path = "../my/home_pollaction.ost?code=" + code + "&select_val=" + select_val + "&mode=do";
	window.open(path,"poll","width=1,height=1");	
}
function view(what) { 
	var imgwin = window.open("",'WIN','scrollbars=yes,status=no,toolbar=no,resizable=no,location=no,menu=no,width=10,height=10'); 
	imgwin.focus(); 
	imgwin.document.open(); 
	imgwin.document.write("<html>\n"); 
	imgwin.document.write("<head>\n"); 
	imgwin.document.write("<title>È®´ë ÀÌ¹ÌÁö</title>\n"); //¿ÀÇÂÃ¢ Å¸ÀÌÆ² ÀÌ¸§ ÁöÁ¤ÇÏ´Â ºÎºÐ 
	imgwin.document.write("<sc"+"ript>\n"); 
	imgwin.document.write("function resize() {\n"); 
	imgwin.document.write("pic = document.il;\n"); 
	//imgwin.document.write("alert(eval(pic).height);\n"); 
	imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
	imgwin.document.write(" if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 20; myWidth = eval(pic).width + 26; if(myWidth>1024)myWidth=1024;if(myHeight>768)myHeight=768;\n"); 
	imgwin.document.write(" } else { myHeight = eval(pic).height + 9; myWidth = eval(pic).width; }\n"); 
	imgwin.document.write(" clearTimeout();\n"); 
	imgwin.document.write(" var height = screen.height;\n"); 
	imgwin.document.write(" var width = screen.width;\n"); 
	imgwin.document.write(" var leftpos = width / 2 - myWidth / 2;\n"); 
	imgwin.document.write(" var toppos = height / 2 - myHeight / 2; \n"); 
	imgwin.document.write(" self.moveTo(leftpos, toppos);\n"); 
	imgwin.document.write(" self.resizeTo(myWidth, myHeight);\n"); 
	imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
	imgwin.document.write("</sc"+"ript>\n"); 
	imgwin.document.write("</head>\n"); 
	imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 
	imgwin.document.write("<img border=0 src="+what+" xwidth=100 xheight=9 name=il onload='resize();' style='CURSOR: hand' onclick=\"javascript:self.close()\">\n"); 
	imgwin.document.write("</body></html>\n"); 
	imgwin.document.close(); 
}

function printDiv () {
	factory.printing.header=""
	factory.printing.footer=""
	factory.printing.leftMargin = 20
	factory.printing.topMargin = 10
	factory.printing.rightMargin = 10
	factory.printing.bottomMargin = 10
	factory.printing.portrait = false
//	factory.printing.PrintHTML(url[, prompt = false])
	factory.printing.Print(false)
	window.print();
}

//-->

function CheckUIElements() {
  var yMenu1From, yMenu1To, yOffset, timeoutNextCheck;
  var wndWidth = parseInt(document.body.clientWidth);
  yMenu1From   = parseInt (qLayer.style.top, 10);
  yMenu1To     = document.body.scrollTop + 130; // À§ÂÊ À§Ä¡
  timeoutNextCheck = 500;

  if ( yMenu1From != yMenu1To ) {
    yOffset = Math.ceil( Math.abs( yMenu1To - yMenu1From ) / 20 );
    if ( yMenu1To < yMenu1From )
      yOffset = -yOffset;

    qLayer.style.top = parseInt (qLayer.style.top, 10) + yOffset;

    timeoutNextCheck = 10;
  }
  qLayer.style.left = 860;
  setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function MovePosition() {
  var wndWidth = parseInt(document.body.clientWidth);

  // Æä¿¡Áö ·Îµù½Ã Æ÷Áö¼Ç
  qLayer.style.top = 130;
  qLayer.style.left = 860;
  qLayer.style.visibility = "visible";

  // initializing UI update timer
  CheckUIElements();
  return true;
}

function flash_load(swf_file,width,height) {
		document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='" + width + "' height='" + height + "' align='middle'>");
		document.write("<param name='allowScriptAccess' value='sameDomain' />");
		document.write("<param name='movie' value='" + swf_file + "' />");
		document.write("<param name='quality' value='high' />");
		document.write("<param name='bgcolor' value='#ffffff' />");
		document.write("<param name='wmode' value='transparent'>");
		document.write("<embed src='" + swf_file + "' quality='high' bgcolor='#ffffff' wmode='transparent' width='" + width + "' height='" + height + "' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
		document.write("</object>");
	}

function open_url(url,name,width,height) {
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	var env = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",scrollbars=yes,statebars=yes";
	
	remote = window.open(url,name,env);
	remote.focus();
}

