﻿/*
NTREEV SOFT UI DEVELOPER YJM
2010.02.01
*/

function leagueCompOpen()
{
    var obj_showLeagueInfoBoard = document.getElementById("showLeagueInfoBoard");
    if (obj_showLeagueInfoBoard)
    {
        obj_showLeagueInfoBoard.style.display = "block";
    }
}
function leagueCompClose()
{
    var obj_showLeagueInfoBoard = document.getElementById("showLeagueInfoBoard");
    if (obj_showLeagueInfoBoard)
    {
        obj_showLeagueInfoBoard.style.display = "none";
    }
}

function guidePop() {
	window.open("/Guide/guideIntro.html","GuidePop","width=920, height=630, resizable=0,status=0,scrollbars=no");
}

function officePop() {
	window.open("/clubinfo/clubinfo.aspx","ClunInfo","width=1013, height=718, resizable=0,status=0,scrollbars=no")
}

function officePopSearch(check, name) {
	window.open("/clubinfo/clubinfo.aspx?radioCheck="+check + "&inputName=" + escape(name),"","width=1013, height=718, resizable=0,status=0,scrollbars=no")
}

// [2010.07.23] addon by io2tree 
// <[ officePop Functions
function officePopPlayer(check, name) {	
	//선수카드 검색
	window.open("/clubinfo/clubinfo.aspx?stcode=A1&radioCheck="+check + "&inputName=" + escape(name),"","width=1013, height=718, resizable=0,status=0,scrollbars=no");
}

function officePopTeam(teamName) {
	//구단검색(구단)
	window.open("/clubinfo/clubinfo.aspx?stcode=B1&teamname=" + escape(teamName),"","width=1013, height=718, resizable=0,status=0,scrollbars=no");
}

function officePopTeamOwner(teamOwnerName) {
	//구단검색(구단주)
	window.open("/clubinfo/clubinfo.aspx?stcode=B2&teamownername=" + escape(teamOwnerName),"","width=1013, height=718, resizable=0,status=0,scrollbars=no");
}

function officePopLeague(worldCode, rankCode, leagueCode) {
	//리그검색(리그)
	window.open("/clubinfo/clubinfo.aspx?stcode=C1&worldcode=" + worldCode + "&rankcode=" + rankCode + "&leaguecode=" + escape(leagueCode),"","width=1013, height=718, resizable=0,status=0,scrollbars=no");
}

function officePopLeagueOwner(leagueOwnerName) {
	//C2
	//리그검색(구단주)
	window.open("/clubinfo/clubinfo.aspx?stcode=C2&leagueownername=" + escape(leagueOwnerName),"","width=1013, height=718, resizable=0,status=0,scrollbars=no");
}
// officePop Functions ]>

function addLoadEvent(func) { 
	var oldonload = window.onload; 
	if(typeof window.onload != 'function') { 
		window.onload = func; 
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}


//login Control
function loginTextBefore() {
	if(!document.getElementById && !document.getElementsByTagName) return false;
	if(!document.getElementById("loginBox")) return false;
	var sideBar = document.getElementById("loginBox");
	var loginText_ul = sideBar.getElementsByTagName("ul");
	var loginText_li = loginText_ul[0].getElementsByTagName("input");
	if(loginText_ul[0].className == "inputArea") {
		loginText_li[0].onfocus = function() {
			this.className='textFieldBg_id';
		}
		loginText_li[0].onblur = function() {
			if(this.value=='') {
				this.className='textField_id';
			}
		}
		loginText_li[1].onfocus = function() {
			this.className='textFieldBg_pw';
		}
		loginText_li[1].onblur = function() {
			if(this.value=='') {
				this.className='textField_pw';
			}
		}
	}
	else {
		loginText_ul[0].refresh; //Ajax Code handling
	}
}






function gameStartOpen() {
	var sideBar = document.getElementById("sideBar");
	var sideBarChilds = sideBar.getElementsByTagName("div");
	sideBarChilds[0].style.width = 270 + "px";
}
function gameStartClose() {
	var sideBar = document.getElementById("sideBar");
	var sideBarChilds = sideBar.getElementsByTagName("div");
	sideBarChilds[0].style.width = 222 + "px";
}


/*
function gameStartGo(w) {
	var sideBar = document.getElementById("sideBar");
	var sideBarChilds = sideBar.getElementsByTagName("div");
	if(sideBarChilds[0].style.overflow == "visible") {
		sideBarChilds[0].style.overflow = "visible";
		sideBarChilds[0].style.width = w + "px";
	}
	else {
		sideBarChilds[0].style.overflow = "hidden";
		sideBarChilds[0].style.width = w + "px";
	}
}
*/



function managerOpen() {
	var showManagerBoard = document.getElementById("showManagerBoard");
	showManagerBoard.style.display = "block";
}

function managerClose () {
	var showManagerBoard = document.getElementById("showManagerBoard");
	showManagerBoard.style.display = "none";
}


function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
		}
		else {
			return document[movieName];
		}
}


function managerControl() {
	var header = document.getElementById("header");
	var headerChilds = header.getElementsByTagName("div");
	//var flash = window.movie || document.movie;
	var managerBefore = document.getElementById("managerBefore");
	var showManager = document.getElementById("showManager");
	managerBefore.onmouseover = function() {
		thisMovie("showManager").overAction();
		//alert(showManager.nodeName)
	}
	managerBefore.onmouseout = function() {
		thisMovie("showManager").outAction();
	}
}

function managerControl02() {
	var header = document.getElementById("header");
	var headerChilds = header.getElementsByTagName("div");
	//var flash = window.movie || document.movie;
	var managerAfter = document.getElementById("managerAfter");
	var showManager = document.getElementById("showManager");
	managerAfter.onmouseover = function() {
		thisMovie("showManager").overAction();
		//alert(showManager.nodeName)
	}
	managerAfter.onmouseout = function() {
		thisMovie("showManager").outAction();
	}
}

function managerControl03() {
	var header = document.getElementById("header");
	var headerChilds = header.getElementsByTagName("div");
	//var flash = window.movie || document.movie;
	var managerAfter02 = document.getElementById("managerAfter02");
	var showManager = document.getElementById("showManager");
	managerAfter02.onmouseover = function() {
		thisMovie("showManager").overAction();
		//alert(showManager.nodeName)
	}
	managerAfter02.onmouseout = function() {
		thisMovie("showManager").outAction();
	}

}
	

	



//Flash Control (JSON Type) 
jmSwf = {
	create: function(id, url, width, height, altText, flashVars, wmode) {
		if (!flashVars) flashVars = '';
		if (!wmode) wmode = 'window';
		if (!altText) altText = '';
		return [
			'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="' + width + '" height="' + height + '" id="' + id + '">',
			'<param name="movie" value="' + url + '" />' ,
			'<param name="wmode" value="' + wmode + '" />' ,
			'<param name="FlashVars" value="' + flashVars + '" />' ,
			'<param name="allowScriptAccess" value = "always" />',
			'<param name="menu" value="false" />' ,
			'<!--[if !IE]>-->' ,
			'<object type="application/x-shockwave-flash" data="' + url + '" width="' + width + '" height="' + height + '" name="' + id + '">' ,
			'<param name="wmode" value="' + wmode + '" />' ,
			'<param name="FlashVars" value="' + flashVars + '" />' ,
			'<param name="menu" value="false" />' ,
			'<param name="allowScriptAccess" value = "always" />',
			'<!--<![endif]-->' ,
			'<p class="alt-content alt-' + id + '">' + altText + '</p>' ,
			'<!--[if !IE]>-->' ,
			'</object>' ,
			'<!--<![endif]-->' ,
			'</object>'	
		].join('');
	},
	write: function(id, url, width, height, altText, flashVars, wmode) {
		document.write(this.create(id, url, width, height, altText, flashVars, wmode))
	}
}


addLoadEvent(loginTextBefore);

