// 1.Random Function (1~max)
function SkyRandom(max){
	try	{
		return (Math.floor(Math.random()*max+1));
	} catch(e) {
		return -1;
	}
}
// 2.Sky Get Parameter Function
function SkyGetParameter(param) {
	var paramArr, tempArr;
	var url, temp1, temp2;
	var ret = "";
	try {
		temp1 = "";
		temp2 = new String(param);
		url = new String(document.location);
		if(url.indexOf("?")>-1) {
			paramArr = url.substring(url.indexOf("?")+1, url.length).split("&");
			if (paramArr!=null && paramArr.length>0) {
				for(i=0; i<paramArr.length; i++) {
					tempArr = paramArr[i].split("=");
					temp1 = new String(tempArr[0]);
					if(temp1.toLowerCase()==temp2.toLowerCase() && tempArr.length>1) {
						ret = new String(tempArr[1]);
					}
				}
			}
		}
	} catch(e) {
	}
	return ret;
}
// 3.Window Open Function
function SkyWindowOpen(url, name, option) {
	try	{
		window.open(url, name, option);
	} catch(e) {
	}
	return;
}
// 4.Alert Function
function SkyAlert(title, msg, width, height) {
	try {
		if(navigator.appVersion.indexOf("NT 5.1")==(-1)){
			window.showModalDialog("/common/popmessage/SkyAlert.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ height +"px; status:no; help:no; resize:no; scroll:no;");
		}else {
			window.showModalDialog("/common/popmessage/SkyAlert.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ (height+24) +"px; status:no; help:no; resize:no; scroll:no;");
		}
	} catch(e) {
	}
}
// 5.Confirm Function
function SkyConfirm(title, msg, width, height) {
	var ret;
	try {
		if(navigator.appVersion.indexOf("NT 5.1")==(-1)){
			ret = window.showModalDialog("/common/popmessage/SkyConfirm.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ height +"px; status:no; help:no; resize:no; scroll:no;");
		}else {
			ret = window.showModalDialog("/common/popmessage/SkyConfirm.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ (height+26) +"px; status:no; help:no; resize:no; scroll:no;");
		}
	} catch(e) {
		ret = -1;
	}
	return ret;
}


// 6.Alert Function(¿©¿ìÃ¤ÆÃ¿ë)
function SkyAlertFox(title, msg, width, height) {
	try {
		if(navigator.appVersion.indexOf("NT 5.1")==(-1)){
			window.showModalDialog("/common/popmessage/SkyAlertFox.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ height +"px; status:no; help:no; resize:no; scroll:no;");
		}else {
			window.showModalDialog("/common/popmessage/SkyAlertFox.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ (height+24) +"px; status:no; help:no; resize:no; scroll:no;");
		}
	} catch(e) {
	}
}
// 7.Confirm Function(¿©¿ìÃ¤ÆÃ¿ë)
function SkyConfirmFox(title, msg, width, height) {
	var ret;
	try {
		if(navigator.appVersion.indexOf("NT 5.1")==(-1)){
			ret = window.showModalDialog("/common/popmessage/SkyConfirmFox.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ height +"px; status:no; help:no; resize:no; scroll:no;");
		}else {
			ret = window.showModalDialog("/common/popmessage/SkyConfirmFox.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ (height+26) +"px; status:no; help:no; resize:no; scroll:no;");
		}
	} catch(e) {
		ret = -1;
	}
	return ret;
}

// 6.Alert Function(´Á´ëÃ¤ÆÃ¿ë)
function SkyAlertWolf(title, msg, width, height) {
	try {
		if(navigator.appVersion.indexOf("NT 5.1")==(-1)){
			window.showModalDialog("/common/popmessage/SkyAlertWolf.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ height +"px; status:no; help:no; resize:no; scroll:no;");
		}else {
			window.showModalDialog("/common/popmessage/SkyAlertWolf.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ (height+24) +"px; status:no; help:no; resize:no; scroll:no;");
		}
	} catch(e) {
	}
}

// 7.Confirm Function(´Á´ëÃ¤ÆÃ¿ë)
function SkyConfirmWolf(title, msg, width, height) {
	var ret;
	try {
		if(navigator.appVersion.indexOf("NT 5.1")==(-1)){
			ret = window.showModalDialog("/common/popmessage/SkyConfirmWolf.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ height +"px; status:no; help:no; resize:no; scroll:no;");
		}else {
			ret = window.showModalDialog("/common/popmessage/SkyConfirmWolf.htm?title=" + title + "&msg="+ msg, "SkyLove", "dialogWidth:"+ width +"px; dialogHeight:"+ (height+26) +"px; status:no; help:no; resize:no; scroll:no;");
		}
	} catch(e) {
		ret = -1;
	}
	return ret;
}
function sendCommand(f) {
	window.returnValue = f;
	window.close();
}
		 
function getQueryString(form){
	var ret="";
	for(i=0; i<form.elements.length; i++){
		ret+=form.elements[i].name+"="+form.elements[i].value+"&";
	}
	return ret;
	
}

