
function goLogin()
{
	setReturnURL(document.location);
	window.location = "http://www.gajagolf.net/login.asp";
}

function goLogin1()
{
	setReturnURL(document.location);
	window.location = "http://www.gajagolf.net/tour/login.asp";
}

function goLogout()
{
	setReturnURL(document.location);
	window.location = "http://www.gajagolf.net/logout_proc.asp";
}

function goSignin()
{
	window.location = "http://www.gajagolf.net/member/agree.asp";
}

function goSignout()
{
	window.location = "http://www.gajagolf.net/member/user_del.asp";
}

function goIDFind()
{
	id_find_win = window.open("http://www.gajagolf.net/member/user_id_find.asp", "id_find_win", "width=400,height=400,scrollbars=no,resizable=no");
	id_find_win.focus();
}

function goUserInfo()
{
	setReturnURL(document.location);
 	window.location = "http://www.gajagolf.net/member/user_info_edit.asp";
}

function goHome()
{
	window.top.location = "http://www.gajagolf.net/";
}

function goTourInfo(tid, sdate, pid, day, didx, area1, area2, area3)
{
	if (sdate == undefined) sdate = "";
	if (pid == undefined) pid = "";
	if (day == undefined) day = "";
	if (didx == undefined) didx = "";
	if (area1 == undefined) area1 = "";
	if (area2 == undefined) area2 = "";
	if (area3 == undefined) area3 = "";
	
	window.location = "http://www.gajagolf.net/tour/tour_info.asp?tid=" + tid + "&sdate=" + sdate + "&pid=" + pid + "&day=" + day + "&didx=" + didx + "&area1=" + area1 + "&area2=" + area2 + "&area3=" + area3;
}

function goCustCenter()
{
	window.location = "http://www.gajagolf.net/custcenter/board.asp?bid=BNotice";
}

function submitGlobalSearch(form)
{
	var cnt = 0;
	
	if (form.Option.value == "") {
		alert("°Ë»ö ¿É¼ÇÀ» ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À");
		form.Option.focus();
		return false;
	}

	for (var i = 0; i < form.Keyword.value.length; i++) {
		if (form.Keyword.value.charAt(i) == ' ')
			cnt++;
	}
    
	if (form.Keyword.value.length == cnt) {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À");
		form.Keyword.focus();
		return false;
	}
	
	return true;
}

function setGlobalSearchOption(opt)
{
	if (document.form_GlobalSearch != "undefined") {
		document.form_GlobalSearch.Option.value = opt;
	}
}

function setGlobalSearchKey(key)
{
	if (document.form_GlobalSearch != "undefined") {
		document.form_GlobalSearch.Keyword.value = key;
	}
}


function new_win(win_url, win_name, width, height, opt)
{
	return window.open(win_url, win_name, "width=" + width + ",height=" + height + ",status=yes,scrollbars=yes,resizable=no");
}

function new_win_ex(win_url, win_name, width, height, opt)
{
	return window.open(win_url, win_name, "width=" + width + ",height=" + height + "," + opt);
}

function setReturnURL(URL)
{
	setCookie("GAJAGOLF_RETURL", URL);
}


function new_win(win_url, win_name, width, height)
{
	return window.open(win_url, win_name, "width=" + width + ",height=" + height + ",status=yes,scrollbars=yes,resizable=no");
}

function new_win_ex(win_url, win_name, width, height, opt)
{
	window.open(win_url, win_name, "width=" + width + ",height=" + height + "," + opt);
}

function min(val1, val2)
{
	if (val1 > val2)
		return val2;
	else
		return val1;
}

function max(val1, val2)
{
	if (val1 > val2)
		return val1;
	else
		return val2;
}

function getCookie(name)
{
  var search;

  search = name + "=";
  offset = document.cookie.indexOf(search);
  
  if (offset != -1) {
    offset += search.length;
    end = document.cookie.indexOf(";", offset);
    if (end == -1)
      end = document.cookie.length;

    return unescape(document.cookie.substring(offset, end));
  }
  else
    return "";
    
}

function setCookie(name, value, expDay)
{
	var cookieStr = name + "=" + escape(value) + "; domain=gajagolf.net; path=/;";
	
	if (expDay) {
		var dToday = new Date();
		dToday.setDate(dToday.getDate() + expDay);
		cookieStr += " expires=" + dToday.toGMTString() + ";";
	}
	
	document.cookie = cookieStr;
}

function delCookie(name)
{
	var dToday = new Date();
	dToday.setDate(dToday.getDate() - 1);
	document.cookie = name + "=; domain=gajagolf.net; path=/; expires=" + dToday.toGMTString() + ";";
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

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_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_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];}
}

// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, À©µµ¿ì¸ðµå)
function flashWrite(url,w,h,id,bg,win) {

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}

