
var utcTime = "";




function switchLang(from,to) {
	var currentStr = window.location.href;
	currentStr = currentStr.replace("/" + from + "/", "/" + to + "/");
	currentStr = currentStr.replace("lang=" + from, "lang=" + to);
	window.location.href = currentStr;
}

function getGMTDiff()
{
	return "8,-5,-5,-6,-8";
}

function getUTCTime()
{
	return utcTime;
}
 
function getServerUTCTime(data)
{
	utcTime= data;
}


function getSkipIntro() {
	return isSkip;
}

function getServerIsSkip(data)
{ 
	isSkip= data;
}

function getBrowserClientWidth() {
	if (typeof(window.innerWidth) == 'number') {
		// Non-IE
		return window.innerWidth;
	} else if (document.documentElement && document.documentElement.clientWidth) {
		//IE 6+ in 'standards compliant mode'
		return document.documentElement.clientWidth;
	} else if (document.body && document.body.clientWidth) {
	    //IE 4 compatible
		return document.body.clientWidth;
	}
	return 0;
}

function getBrowserClientHeight() {
	if (typeof(window.innerHeight) == 'number') {
		// Non-IE
		return window.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		//IE 6+ in 'standards compliant mode'
		return document.documentElement.clientHeight;
	} else if (document.body && document.body.clientHeight) {
	    //IE 4 compatible
		return document.body.clientHeight;
	}
	return 0;
}

function getParamString() {	// cody.ng 2006.12.18
	var url = location.href;
	var pos = url.indexOf("?");
	if (pos <= 0)
		return "";
	return url.substring(pos + 1, url.length);
}


function getParamStringToArray() { // cody.ng 2006.12.18, ps: the key is in lower case
	var ps = getParamString();
	if (ps == "")
		return;
	var psArray = ps.split("&");

	var arr = new Array();
	for (var i = 0; i < psArray.length; i++) {
		var chunk = psArray[i];
		if (chunk != "") {
			var pair = chunk.split("=");
			if (pair.length == 2) {
				arr[pair[0].toLowerCase()] = pair[1];
			}
		}
	}		
	return arr;
}


