
//Browser Check
var browserType=new checkBrowserType();
var osType=new checkOsType();
function checkBrowserType(){
	this.IE=(navigator.userAgent.indexOf("MSIE")!=-1);
	this.Gecko=(navigator.userAgent.indexOf("Gecko")!=-1);
	this.IE6=(navigator.userAgent.indexOf("MSIE 6.")!=-1);
	this.IE5=(navigator.userAgent.indexOf("MSIE 5.")!=-1);
	this.NC71=(navigator.userAgent.indexOf("Netscape/7.1")!=-1);
	this.NC70=(navigator.userAgent.indexOf("Netscape/7.0")!=-1);
	this.NC6=(navigator.userAgent.indexOf("Netscape/6.")!=-1);
	this.NC7=(navigator.userAgent.indexOf("Netscape/7.")!=-1);
	this.NC4=(navigator.userAgent.indexOf("Netscape/4.")!=-1);
	this.Wii=(navigator.userAgent.indexOf("Nintendo Wii")!=-1);
}
function checkOsType(){
	this.Win=(navigator.appVersion.indexOf("Win")!=-1);
	this.Mac=(navigator.appVersion.indexOf("Mac")!=-1);
	this.Unix=(navigator.appVersion.indexOf("X11")!=-1);
}


//display Alert not Wii Browser
function displayAlert(){
	var displayArea = document.getElementById("mainCaution");
	if(displayArea){
		displayArea.style.display="block";
		return false;
	} else{
		return false;
	}
}


//Script For Change Image
function initRollovers() {
	if (!document.getElementById) return

	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	var iImages = document.getElementsByTagName('input');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}

	for (var i = 0; i < iImages.length; i++) {		
		if (iImages[i].className == 'imgover') {
			var src = iImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);

			iImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			iImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			iImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}

}



//Script For Popup
function doPopup() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");

	for (var i=0; i < links.length; i++) {
		if(links[i].className.match("popup")) {
			links[i].onclick = function() {
			window.open(this.href ,"popwWindow","scrollbars=no,width=420,height=580");
			return false;
			}
		}
	}
	return false;
}


//Script For SearchArea
function focusClear(){
var txt_flg = false;
	if(!txt_flg){
		txt_flg = true;
		document.getElementById("txtSrchKeyword").value="";
		document.getElementById("txtSrchKeyword").style.color = '#000';
	}
}


//onload Script
function loadProcess() {
	initRollovers();
	doPopup();
	if(!browserType.Wii){
		displayAlert();
	}
}

