
function showSite(sSiteURL, bandWidth, startWithLogin, lowres) {
	var width = screen.width; //950; //
	var height = screen.height; //590; //
	var left = (screen.width / 2) - ((width + 10) / 2); // 0;
	if (left < 0)
	    left = 0;
	var top = (screen.height / 2) - ((height + 55) / 2); //0;
	if (top < 0)
	    top = 0;

	
	var sProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left=" + left + ",top=" + top + ",width=" + width + ",height=" + height;

	sSiteURL = sSiteURL + "?language=" + escape(sLanguage);
	sSiteURL = sSiteURL + "&market=" + escape(sMarket);
	sSiteURL = sSiteURL + "&pool=" + escape(sSiteId);
	sSiteURL = sSiteURL + "&instance=" + escape(sInstance);
	//sSiteURL = sSiteURL + "&variant=" + escape(sVariant);
	//sSiteURL = sSiteURL + "&section=" + escape(sSection);
	//sSiteURL = sSiteURL + "&showintro=" + escape(sShowIntro);
	//sSiteURL = sSiteURL + "&bandwidth=" + escape(bandWidth);
	sSiteURL = sSiteURL + "&width=" + escape(width);
	sSiteURL = sSiteURL + "&height=" + escape(height);

	sSiteURL += "&deeplink=" + sDeeplink;  /*getQueryVariable('deeplink')*/
	//sSiteURL += "&model=" + getQueryVariable('model');
	//sSiteURL += "&from_dvd=" + getQueryVariable('from_dvd');
	//sSiteURL += "&dvd_data=" + getQueryVariable('dvd_data');
	
	//sSiteURL += "&specialguest=" + escape(sSpecialguest); 
	sSiteURL += "&startWithLogin=" + escape(startWithLogin);
	lowres = (lowres == null) ? 'false' : ((lowres == 'true') ? 'true' : 'false');
    sSiteURL += "&lowres=" + escape(lowres);
	var site = window.open(sSiteURL, "porschemicrosite", sProps);
	
	site.focus();
}


function getQueryVariable(qv) {
    var pairs = getQueryString().split("&");
    for (i = 0; i < pairs.length; i++) {
        var pair = pairs[i].split("=");
        if (pair[0] == qv) {
            return escape(pair[1]);
        }
    }
    return '';
}

function track(trackingURL) {
    //takes an imageURL 2 load a TrackingImg

    $("<div style=\"position:absolute;\"><img src=\"" + trackingURL + "\"  style=\"display:none !important;width:1px; height:1px;\" /></div>").appendTo('body');

}
function getQueryString() {
    return window.location.search.substring(1);
}
function openNewWindow(sURL, windowName) {
    var sProps = "toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,left=0,top=0";
    openNewWindow(sURL, windowName, sProps);
}
function openNewWindow(sURL, windowName, sProps) {
    var miscWin = window.open(sURL, windowName, sProps);
    miscWin.focus();
}
