var site_domain = "www.38.co.kr";

function login_alert (login_url) {
  if (confirm('º» ¼­ºñ½º´Â ·Î±×ÀÎÀ» ÇÏ¼Å¾ß »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?')) {
     location.href=login_url;
  } else {
	  history.go(-1);
	  return false;
  }
  return false;
}

function go_menu(file) {
	top.location.href="http://"+site_domain+"/"+file;
}

//»çÀÌ¹ö¸Ó´Ï
function cyber_win(url,nwidth,nheight) {

	newwin = window.open(url,"thewindow",'toolbar=no,status=yes,scrollbars=1,resizable=0,width='+nwidth+',height='+nheight)

}

function refill_post (url) {
	var urlOpt = "scrollbars=yes, resizable=no, width=650,height=560, left=150, top=80";
	window.open(url,'putsid',urlOpt);
}

//Login
 function check_form()
{
	if( document.loginform.id.value == "" )
		{
		alert( "¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä!" );
		document.loginform.id.focus();
		return( false );
		}
	if( document.loginform.passwd.value == "" )
		{
		alert( "ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä!" );
		document.loginform.passwd.focus();
		return( false );
		}
	
	return (true);	
}
//µî·Ï½É»ç ¸ÞÀÎÈ­¸é ½ºÅ©¸³Æ®
function ipo_layer(w)
{
	for (i=1;i<4;i++) {
		var dipo='ipo_win'+i;
		var dimg='img_win'+i;
		if (document.all[dipo].style.display=="") {
			document.all[dipo].style.display = "none";
		}
		if (document.all[dimg].style.display=="none") {
			document.all[dimg].style.display = "";
		}
	}
	var ipo='ipo_win'+w;
	var img='img_win'+w;
	document.all[ipo].style.display = "";
	document.all[img].style.display = "none";
}

//¸ÞÀÎ »õÃ¢
function new_win(url,nwidth,nheight) {

	newwin = window.open(url,"thewindow",'toolbar=no,status=no,scrollbars=1,resizable=0,width='+nwidth+',height='+nheight)

}
//½ºÅ©·Ñ¾ø´Â Ã¢
function no_win(url,nwidth,nheight) {

	newwin = window.open(url,"thewindow",'toolbar=no,status=no,scrollbars=0,resizable=0,width='+nwidth+',height='+nheight)

}

//Ã­Æ®¿ÀÇÂ
function ad_winopen(url){
		window.open(url,'adwin','toolbar=no,status=no,scrollbars=no,menubar=no,location=no,resizable=no,width=608,height=560,left=0,top=0');
}
//¾÷Ã¼È¨ÆäÀÌÁö
function new_winopen(url){
		window.open(url,'newwin','toolbar=yes,status=yes,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=1000,height=600,left=0,top=0');
}
//´º½ºÃ¢
function AllNews() 
{    
 window.open('http://www.38.co.kr/html/news/allnews.php3','allNews','left=0,height=600,width=800,scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no');

}

function openNews(page) {
	var newsWindow = openWindow(page, 600, 800, 'news');
	newsWindow.focus();
}




function new_fopen(url,width,height){
		window.open(url,'newwin','toolbar=no,status=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height+',left=0,top=0');
}

function openWindow(url, width, height, popupName) {
	var urlOpt = "scrollbars=no, resizable=yes, width=" + width + ",height=" + height + ", left=150, top=150";
	return window.open(url, popupName, urlOpt);
}

function openWindowFixed(url, width, height, popupName) {
	var urlOpt = "scrollbars=no, resizable=no, width=" + width + ",height=" + height + ", left=150, top=150";
	return window.open(url, popupName, urlOpt);
}

function openWindowScroll(url, width, height, popupName) {
	var urlOpt = "scrollbars=yes, resizable=yes, width=" + width + ",height=" + height + ", left=150, top=150";
	return window.open(url, popupName, urlOpt);
}

function openWindowPos(url, width, height, popupName, left, top) {
	var urlOpt = "scrollbars=no, resizable=yes, width=" + width + ",height=" + height + ", left=" + left + ", top=" + top + " ";
	return window.open(url, popupName, urlOpt);
}

function openWindowFixedPos(url, width, height, popupName, left, top) {
	var urlOpt = "scrollbars=no, resizable=no, width=" + width + ",height=" + height + ", left=" + left + ", top=" + top;
	return window.open(url, popupName, urlOpt);
}

function openWindowScrollPos(url, width, height, popupName, left, top) {
	var urlOpt = "scrollbars=yes, resizable=yes, width=" + width + ",height=" + height + ", left=" + left + ", top=" + top;
	return window.open(url, popupName, urlOpt);
}

function openPage(URL, w, h) {
	if (!w) w=400;
	if (!h) h=300;

window.open(URL, 'oopen', 'left=50, top=50, width='+ w +', height='+ h +', scrollbars=0');
}

function handlePageKeyDown(keyStroke) 
{ 
	//N:78, R:82, F5:116
	isNetscape=(document.layers); 
	eventChooser = (isNetscape) ? keyStroke.which : event.keyCode; 

	if((event.ctrlKey == true && eventChooser == 82)){
		event.keyCode = 0; 
		event.cancelBubble = true; //ÀÌº¥Æ®°¡ ÀÏ¾î³ª´Â°É Ãë¼Ò.
		event.returnValue = false;  //ÀÌº¥Æ®·Î ÀÎÇÑ ¹ÝÈ¯°ªÀ» Ãë¼Ò.
		//document.oncontextmenu; //¸¶¿ì½º ¿À¸¥ÂÊÀ» ´­·¶À»¶¼ ³ª¿À´Â ¸Þ´º.
	}

} 

//document.onmousedown = handlePageMouseClick; 
document.onkeydown = handlePageKeyDown; 




 //Keyword
 function clearQueryBackgroundImage(frm){		
	frm.style.backgroundImage="";		
}
function setDefaultQuery(frm){
	if (!frm)
	{
		return false;
	}
	if(keySearch.event){
		if (eventWhat==1) {
			frm.style.backgroundImage=keySearch.eventImage[eventNum];
		} else {
			frm.value=keySearch.eventValue[eventNum];
			frm.style.color=keySearch.eventColor[eventNum];
			
		}
	}
}
function setQuery(frm,sVal){
	frm.value=sVal;
}

function setText(frm,key) {
	if (key || event.keyCode != 13) {
		frm.value = "";
		frm.style.color='black';
	}
}

function Searchtext(){
	this.event=true;

	this.eventValue=new Array(4);
	this.eventValue[0]="µ¿È£È¸ °Ô½Ã¹° µî·Ï=38¸Ó´ÏÁö±Þ!";
	//this.eventValue[1]="ÅøÁ¨ - ½Å¾à°³¹ß¿ë±â¼ú ÇØ¿ÜÀÌÀü!!";
	//this.eventValue[2]="°Ë»ö¾î ±¤°í¹®ÀÇ - 02)841-3838 ";
	//this.eventValue[3]="Å°¿öµå3";

	this.eventColor=new Array(4);
	this.eventColor[0]="#CC0000";
	//this.eventColor[1]="red";
	//this.eventColor[2]="red";
	//this.eventColor[3]="red";
}

var lrand = Math.random().toString(); 
var ltmpval = lrand.substring(2,lrand.length); 
var keyval = 0;//ltmpval%2;

var eventNum=keyval;
var eventWhat=0;
var keySearch=new Searchtext();
//end keyword