function goHome() {
	if (window.opener && !window.opener.closed) {
		window.opener.location.href = sHomeURL;
		self.close();
	} else {
		var home = window.open(sHomeURL);
		home.focus();	
	}
}

function showWallpaper(sURL) {
	var iWidth = 800;
	var iHeight = 500;
	var sProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,left=" + Math.round((screen.width - iWidth) / 2) + ",top=" + Math.round((screen.height - iHeight) / 2) + ",width=" + iWidth + ",height=" + iHeight;
	var wallpaper = window.open(sURL,"wallpaper", sProps);
	wallpaper.focus();		
}

function openCC(sURL) {
	var iWidth = 960;
	var iHeight = 652;
	var sProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left=" + Math.round((screen.width - iWidth) / 2) + ",top=" + Math.round((screen.height - iHeight) / 2) + ",width=" + iWidth + ",height=" + iHeight;
	var PVA = window.open(sURL,"PVA", sProps);
	PVA.focus();
}

function openWindow(sURL, iWidth, iHeight) {
	openWindowMain(sURL, iWidth, iHeight, false);
}

function openWindowScrollable(sURL, iWidth, iHeight) {
	openWindowMain(sURL, iWidth, iHeight, true);
}

function openWindowMain(sURL, iWidth, iHeight, isScrollable) {
	var scrollbars = (isScrollable ? "1" : "0");
	var sProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scrollbars + ",resizable=0,left=" + Math.round((screen.width - iWidth) / 2) + ",top=" + Math.round((screen.height - iHeight) / 2) + ",width=" + iWidth + ",height=" + iHeight;
	var miscWin = window.open(sURL, "miscWin", sProps);
	miscWin.focus();
}

function setStartpage(elmThis) {
    if (document.getElementById) {
        var sUrl = elmThis.value;
        if (sUrl != "") {
            var elem = document.getElementById("selectedCountry");
            if (elem) {
                elem.value = sUrl;
            }
            document.forms[0].submit();
        }
    }
}


function downloadUrl(sURL) {
    window.location.href = "../aspx/download.aspx?file=" + sURL;
}

function userAgent() {
    return (function x() { })[-5] == 'x' ? 'FF3' : (function x() { })[-6] == 'x' ? 'FF2' : /a/[-1] == 'a' ? 'FF' : '\v' == 'v' ? 'IE' : /a/.__proto__ == '//' ? 'Safari' : /s/.test(/a/.toString) ? 'Chrome' : /^function \(/.test([].sort) ? 'Opera' : 'unknown'

}
function getQueryString() {
    return window.location.search.substring(1);
}

function getQueryVariable(qv) {
    var pairs = getQueryString().split("&");
    for (i = 0; i < pairs.length; i++) {
        var pair = pairs[i].split("=");
        if (pair[0] == qv) {
            return pair[1];
        }
    }
    return '';
}

