function GoMenu(name) {
	var strUrl = eval(name);
			
	if (strUrl == "") {
		alert("¼­ºñ½º ÁØºñÁßÀÔ´Ï´Ù.");
		return;
	} else {
		document.location.href = strUrl;
	}
}
		
function PopUp(url, w, h, s) {
		LeftPosition = (screen.width) ? (screen.width-w)/0 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/0 : 0;	
		var win = window.open(url, "popup", "left="+LeftPosition+",top="+TopPosition+", scrollbars="+s+",height="+h+",width="+w);
		win.focus();
}

function PopUp1(url, w, h, s) {
		LeftPosition = (screen.width) ? (screen.width-w)/0 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/0 : 0;	
		var win = window.open(url, "popup1", "left="+LeftPosition+",top="+TopPosition+", scrollbars="+s+",height="+h+",width="+w);
		win.focus();
}
		
function ObjNullChk(obj, msg){
	if(obj.value.replace(/^\s*/,'').replace(/\s*$/,'')==""){
		alert(msg);
		obj.focus();
		return true;
	}else{
		return false;
	}
}

function ImageFileCheck ( field , info ){ 
	if ( field.value != "" ) {
		var maxi = field.value.length;
		var ext = field.value.substring(maxi-3, maxi);
		ext = ext.toLowerCase();

		if (ext != "gif" && ext != "jpg") {
			alert(info + "Àº(´Â) gif È¤Àº jpg ±×¸²¸¸ »ç¿ëÇØÁÖ¼¼¿ä.");
			return false;
		}
	}
	return true;
}

//===================================
//	µû¿ÈÇ¥¿Í ½Ö µû¿ÈÇ¥
//===================================
function CheckEnglishOnly(field, info){
	var ln = field.value.length;
	var chSpecial = false;

	for (var i=0; i<ln; ++i) {
		var ch = field.value.charAt(i);
		if (ch == '"' || ch == "'" || ch == "%" || ch == "#") chSpecial = true;
	}
	
	if(chSpecial) {
		alert(info + "¶õÀº [¿Üµû¿ÈÇ¥,½Öµû¿ÈÇ¥,%,#]µîÀÇ ±âÈ£´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
		field.focus();
		return false;
	}
	else
		return true;
}



function hidestatus(){
	window.status=''
	return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus

function bluring()
{ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG")
		document.body.focus(); 
}
document.onfocusin=bluring;

//===================================
//	¸Þ´º ½ºÅ©¸³Æ®
//===================================
function MouseEvent(no, val)
{
	eval('layer_menu'+no).style.visibility = val;
}

function MouseEvent2(no, val)
{
	eval('imgmenu'+no).style.visibility = val;
}
//===================================
//	¼³¹®Á¶»ç
//===================================
function viewPoll()
{
	var url = "/common/poll_01.asp";
	var pollwin = window.open(url,"poll_form","resizable=no, toolbar=no, status=no, menubar=no, scrollbars=yes, width=10, height=10, top=100, left=100");
	pollwin.focus();
}

//===================================
//	cookie ¼³Á¤
//===================================
function setCookie( name, value, expiredays ) 
{ 
  var todayDate = new Date(); 
  todayDate.setDate( todayDate.getDate() + expiredays ); 
  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
}

function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie )
		{
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
				return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}


function viewPoll()
{
	var url = "/common/poll_01.asp";
	var pollwin = window.open(url,"poll_form","resizable=no, toolbar=no, status=no, menubar=no, scrollbars=yes, width=10, height=10, top=100, left=100");
	pollwin.focus();
}


function bookmark(){
	window.external.AddFavorite(location.href,document.title)
}

function goProduct(seq,b_cat,s_cat)
{
	location.href = "/product/view.asp?seq="+seq+"&b_cat="+b_cat+"&s_cat="+s_cat;
}

function goNotice(seq)
{
	location.href = "/customer/notice_view.asp?b_idx=notice&seq="+seq;
}
function goQnA(seq)
{
	location.href = "/customer/view.asp?b_idx=cu_board&seq="+seq;
}
function goQnA_list(seq)
{
	location.href = "/customer/board.asp";
}
function goBoard(seq, b_idx)
{
	location.href = "/board/view.asp?b_idx="+b_idx+"&seq="+seq;
}
function goBoard_list(seq, b_idx)
{
	location.href = "/board/list.asp?b_idx="+b_idx;
}
function go2circle(seq)
{
	location.href = "/dataroom/circle_view.asp?seq="+seq;
}

function view_goods(seq,b_cat)
{
	location.href = "/product/view.asp?b_cat="+b_cat+"&seq="+seq;
}

function go2gonggu(seq)
{
	location.href = "/auction/view.asp?seq="+seq;
}

function goSearch_goods()
{
	var form = document.top_search_form;
	if(form.search_text.value.replace(/^\s*/,'').replace(/\s*$/,'') == "" || form.search_text.value == "»óÇ°¸í ¶Ç´Â »óÇ°ÄÚµå·Î °Ë»öÇØÁÖ¼¼¿ä")
	{
		alert("°Ë»öÇÏ½Ç »óÇ°¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		form.search_text.focus();
		return;
	}
	else
	{	
		if (CheckEnglishOnly(form.search_text, "°Ë»ö¾î"))
		{}
		else
		{
			return;
		}
	}
	form.action = "/product/search_list.asp";
	form.submit();
}

function EnterCheck()
{
	if(event.keyCode==13) //¿£ÅÍÅ°¶ó¸é
  	{
  		event.returnValue = false;
		goSearch_goods();
  	}
}

function popDeliver()
{
	var deliverpop = window.open("/popup/delivery.asp","deliverform","scrollbars=yes,width=10,height=10,top=100,left=100");
	deliverpop.focus();
}

function divhidden(d_id)
{
	document.getElementById(d_id).style.display = "none";
}

function divshow(d_id)
{
	document.getElementById(d_id).style.display = "";
}

function popFreeInt()
{
	var freeintpop = window.open("http://toyjoy.kr/popup/free_interest_pop.asp","freeIntform","scrollbars=no,width=10,height=10,top=100,left=100");
	freeintpop.focus();
}

function MM_openBrWindow(theURL,winName,features) { window.open(theURL,winName,features); }

function src_f(obj)
{
	if (obj.value == "»óÇ°¸í ¶Ç´Â »óÇ°ÄÚµå·Î °Ë»öÇØÁÖ¼¼¿ä")
	{
		obj.value = "";
	}
}

function src_b(obj)
{
	if (obj.value == "")
	{
		obj.value = "»óÇ°¸í ¶Ç´Â »óÇ°ÄÚµå·Î °Ë»öÇØÁÖ¼¼¿ä";
	}
}
