var g_is_ie = false;


function gotoUrlNewWinSizeByName(s, sWidth, sHeight, sName)
{
    sWidth += g_is_ie ? 15 : 20;
    sHeight += 25;
    newWin = window.open(s, sName, "width=" + sWidth + ",height=" + sHeight + ",left=40,top=40,dependent=yes,location=no,resizable=no,scrollbars=no,status=no");
}

function configureCar(marketId)
{
    /* For new CC inner size is important, but gotoUrlNewWinSizeByName() calcs outer size */
    var sWidth = 980;
    var sHeight = 680;
    sWidth -= g_is_ie ? 15 : 20;
    sHeight -= 25;
	
	/* R.W. Anpassung für den Intranet Server, um unterschiedliche CC URL's auszuliefern.*/
	var HostName = "";
	if (window.location.hostname == "intranet.porsche.com") {
		HostName = "http://cc.intranet.porsche.com";
	} else {
		HostName = "http://cc.porsche.com";
	}
		
    switch (marketId) {
        case "de":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?sprache=de&modelRange=null", sWidth, sHeight, "PVA");
            break;

        case "us":
            gotoUrlNewWinSizeByName(HostName + "/pva_new/ui/pva/index.jsp?sprache=us&modelRange=null", sWidth, sHeight, "PVA");
            break;

        case "ca":
            gotoUrlNewWinSizeByName(HostName + "/pva_new/ui/pva/index.jsp?sprache=ca&modelRange=null", sWidth, sHeight, "PVA");
            break;

        case "fr":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?sprache=fr&modelRange=null", sWidth, sHeight, "PVA");
            break;

        case "it":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?sprache=it&modelRange=null", sWidth, sHeight, "PVA");
            break;

        case "en":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?sprache=en&modelRange=null", sWidth, sHeight, "PVA");
            break;

        case "sp":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?sprache=sp&modelRange=null", sWidth, sHeight, "PVA");
            break;

        case "mx":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?sprache=mx&modelRange=null", sWidth, sHeight, "PVA");
            break;
            
        case "hk":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?sprache=hk&modelRange=null", sWidth, sHeight, "PVA");
            break;
		
        case "me":
            gotoUrlNewWinSizeByName('/all/transitional/middle-east/models/countryselector/default.htm', sWidth, sHeight, 'PVA');
            break;
		
        case "jp":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?sprache=pj&modelRange=null", sWidth, sHeight, "PVA");
            break;

        case "zh":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?sprache=cn", sWidth, sHeight, "PVA");
            break;

        case "ba":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?market=PDB&sprache=ba", sWidth, sHeight, "PVA");
            break;
        case "va":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?market=PDD&sprache=va", sWidth, sHeight, "PVA");
            break;
        case "kw":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?market=PDK&sprache=kw", sWidth, sHeight, "PVA");
            break;
        case "oa":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?market=PDO&sprache=oa", sWidth, sHeight, "PVA");
            break;
        case "qu":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?market=PDT&sprache=qu", sWidth, sHeight, "PVA");
            break;
        case "ks":
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?market=PDS&sprache=ks", sWidth, sHeight, "PVA");
            break;
        default:
            gotoUrlNewWinSizeByName(HostName + "/icc_euro/ui/pva/index.jsp?sprache=" + marketId + "&modelRange=null", sWidth, sHeight, "PVA");
            break;

    }
}
