function Redirect(pg) {
	if (typeof(base) == "string" && pg.indexOf("http:")<0) pg = base+pg;
	if (!getCookie("sid")) pg += (pg.indexOf("?")>=1?"&":"?")+"sid="+sidz;
	window.location.href = pg;
}

function getCookie(val) {
	var c = document.cookie.split("; ");
	for (var i=0; i < c.length; i++) {
		var pair = c[i].split("=");
		if (val == pair[0]) return unescape(pair[1]);
	}
	return null;
}

function go(URL){
	window.location.href = URL;
}

function gonw(URL, width, height){
	params = (typeof(width) != "undefined" && typeof(height) != "undefined") ? ",width="+width+",height="+height : "";
	nw = window.open(URL, "", params+" ,resizable=yes, scrollbars=yes");
	return false;
}

function isIE() {
	return (document.all && 'Mi'==navigator.appName.substring(0,2));
}

function addFavorite(address, name, errmsg) {
	if (isIE()) window.external.AddFavorite(address, name);
	else alert(errmsg);
	return false;
}

function setAsHomePage(page, url, errmsg) {
	if (isIE()) {
		page.style.behavior='url(#default#homepage)';
		page.setHomePage(url);
	}
	else alert(errmsg);
	return false;
}