	function tabOn() {
		this.src=this.src.replace('_off','_on');
	}
	function tabOff() {
		this.src=this.src.replace('_on','_off');
	}
	function init(flag) {
		document.getElementById('board1').style.display='none';
		document.getElementById('board2').style.display='none';
		document.getElementById('board3').style.display='none';
		document.getElementById('board4').style.display='none';
		
		document.getElementById('btnBoardMore1').style.display='none';
		document.getElementById('btnBoardMore2').style.display='none';
		document.getElementById('btnBoardMore3').style.display='none';
		document.getElementById('btnBoardMore4').style.display='none';
		
		var arrImg = document.getElementById('boardTab').getElementsByTagName('img');
		
		for(i=0; i<arrImg.length; i++) {
			if(window.ActiveXObject) {
				if(arrImg[i].getAttribute('className')=='btnTab') {
					arrImg[i].src = arrImg[i].src.replace('_on', '_off');
					arrImg[i].onmouseover = tabOn;
					arrImg[i].onmouseout = tabOff;
				}
			} else {
				if(arrImg[i].getAttribute('class')=='btnTab') {
					arrImg[i].src = arrImg[i].src.replace('_on', '_off');
					arrImg[i].onmouseover = tabOn;
					arrImg[i].onmouseout = tabOff;
				}
			}
		}
		
		if(flag) {
			if (document.getElementById('chkSaveid')) {
				var saveid = document.getElementById('chkSaveid');
				var protect = document.getElementById('chkProtect');
				var imgSaveid = document.getElementById('btnSaveid').firstChild;
				var imgProtect = document.getElementById('btnProtect').firstChild;
				
				if(saveid.checked == true)
					imgSaveid.src = imgSaveid.src.replace('_off', '_on');
				if(protect.checked == true)
					imgProtect.src = imgProtect.src.replace('_off', '_on');
			}
			
			document.getElementById('btnBoard1').firstChild.src = document.getElementById('btnBoard1').firstChild.src.replace('_off', '_on');
			document.getElementById('btnBoard1').firstChild.onmouseover = null;
			document.getElementById('btnBoard1').firstChild.onmouseout = null;
			document.getElementById('board1').style.display='block';
			document.getElementById('btnBoardMore1').style.display='block';
			
		}
	}
	function tabSelect(tabNum) {
		
		tabNum = (tabNum) ? tabNum : 1;
		
		init();
		
		var ele = document.getElementById('btnBoard'+tabNum).firstChild;
		
		ele.src = ele.src.replace('_off', '_on');
		ele.onmouseover = null;
		ele.onmouseout = null;

		document.getElementById('board'+tabNum).style.display = 'block';
		document.getElementById('btnBoardMore'+tabNum).style.display = 'block';
	}
	
	function rankTab(tabNum) {
		
		tabNum = (tabNum) ? tabNum : 1;
		
		var ele1 = document.getElementById('btnRank1').firstChild.firstChild;
		var ele2 = document.getElementById('btnRank2').firstChild.firstChild;
		
		switch(tabNum) {
			case 1:
			default:
				ele1.src = "";//ele1.src.replace('_off', '_on');
				ele2.src = "";//ele2.src.replace('_on', '_off');
				ele1.onmouseover = null;
				ele1.onmouseout = null;
				ele2.onmouseover = tabOn;
				ele2.onmouseout = tabOff;
				break;
			case 2:
				ele1.src = "";//ele1.src.replace('_on', '_off');
				ele2.src = "";//ele2.src.replace('_off', '_on');
				ele1.onmouseover = tabOn;
				ele1.onmouseout = tabOff;
				ele2.onmouseover = null;
				ele2.onmouseout = null;
				break;
		}
	}
	
	function toggleChk(btnName) {
		
		btnName = btnName ? btnName : 'saveid';
		var chkBox;
		var imgChk;
		
		if (btnName == 'saveid') {
			chkBox = document.getElementById('chkSaveid');
			imgChk = document.getElementById('btnSaveid').firstChild;
		} else if (btnName == 'protect') {
			chkBox = document.getElementById('chkProtect');
			imgChk = document.getElementById('btnProtect').firstChild;
		}
		
		if(chkBox.checked == false) {
			chkBox.checked = 'checked';
			imgChk.src = imgChk.src.replace('_off', '_on');
		} else {
			chkBox.checked = false;
			imgChk.src = imgChk.src.replace('_on', '_off');
		}
	}
	
	function seePoster(flag) {
	  if(flag == 'load') {
	    var width = (window.innerWidth) ? window.innerWidth : document.body.clientWidth;
			
			if (width < 1347)
				document.getElementById('LocationH2').style.display = 'none';
			else
				document.getElementById('LocationH2').style.display = 'block';
	  }
	  
		window.onresize = function() {
		
			var width = (window.innerWidth) ? window.innerWidth : document.body.clientWidth;
			
			if (width < 1347)
				document.getElementById('LocationH1').style.display = 'none';
			else
				document.getElementById('LocationH1').style.display = 'block';
			
		}
	}
	
function urlCallLink( keyword )
  {
  
  	switch( keyword )
  	{
  		case "siteFreestyle" :
  		{
  			location.href = "/index.asp?ViewType=1";
  			break;
  		}
  		
  		case "micro" :
  		{ 
  		  var fullURL = "/popup/fs2008plus.asp";
  		  window.open(fullURL,"FS2008Plus","fullscreen,scrollbars");
  			break;
  		}
    }
  
  }
	window.onload = function() {
		init('load');
		seePoster('load');
	};