function $() {
	var ret = [];
	for(var i=0; i < arguments.length; i++) {
		if (typeof arguments[i] == 'string') {
			ret[ret.length] = document.getElementById(arguments[i]);
		} else {
			ret[ret.length] = arguments[i];
		}
	}
	return ret[1]?ret:ret[0];
}



// swf movie
function findSwf(movieName){
	var os=navigator.platform;
	if(os == "Win32"){
		var browser = navigator.appName.indexOf("Microsoft");
		if(browser == 0){
			return document.all[movieName];
		}else if(browser == -1){
			return document[movieName];
		}
	}
}

function hideObject (objids) {
	try {
		if ($(objids)) { 
			$(objids).style.display = 'none';
		} 
	} catch (e){
	}
}

function showObject (objids) {
	try {
		if ($(objids)) { 
			$(objids).style.display = 'block';
		}
	} catch (e){
	}
}

function getLenChar(texts) {
	texts =  texts + '';		
	return String.fromCharCode(texts.length);
}

function swfAvailable() {
	if ((navigator.userAgent.indexOf("Opera") != -1)||(navigator.userAgent.indexOf("Safari") != -1)||navigator.platform.indexOf("Mac") != -1 ) {
		return false;
	} else {
		return true;
	}	
}

function activexAvailable() {
	if ((navigator.userAgent.indexOf("Opera") != -1)||(navigator.userAgent.indexOf("Safari") != -1)||navigator.appName.indexOf("Netscape")!=-1||navigator.appName.indexOf("FireFox")!=-1||navigator.platform.indexOf("Mac") != -1 ) {
		return false;
	} else {
		return true;
	}	
}

function viewInformDiv(args) {
	// args
	// 1 :  
	// 2 :  
	// 3 :  
	if(args == 1)		setLoginGenView();
	else if(args == 2)	setLoginJSView();
	else if(args == 3)	setLoginJSView();
	
}

function plainLogin() {
	viewInformDiv(-1);
	parent.onErrorIframe();
}


function setLoginGenView() {
	initEnc = SECUTYPE_GEN;
	showjslogin();
	document.loginform.turtle2.focus();
	//plainLogin();
}

function setLoginJSView() {
	initEnc = SECUTYPE_JS;
	showjslogin();
}

function showflashlogin() {
	showObject('flashTr');
	hideObject('generalTr');
}

function showjslogin() {
	//viewInformDiv(-1);
	showObject('generalTr');
	hideObject('flashTr');		
}

function checkFlashLoad() {
	setTimeout("isflashload()" , 500);
}

function isflashload() {
/*
	if (flashenable==-1) {
		//viewInformDiv(3);
	}
*/	
	if(loadFlash) return true;
}

