﻿// JScript File
function openSwissGeoMap(url)
{
    var popup = window.open(url, '_blank', 'height=500, width=860, top=100, left=100, channelmode=0, directories=0, fullscreen=0, location=0, menubar=0, resizable=0, scrollbars=0, status=0, titlebar=0, toolbar=0');
    popup.focus();
}

function openGisMap(url)
{ 
    if(GISPopupHeight =="")
        GISPopupHeight = 710;
    if(GISPopupWidth =="")
        GISPopupWidth = 820;       
    var popup = window.open(url, '_blank', 'height=' + GISPopupHeight + ', width=' + GISPopupWidth + ', top=100, left=100, channelmode=0, directories=0, fullscreen=0, location=0, menubar=0, resizable=1, scrollbars=0, status=0, titlebar=0, toolbar=0');
    popup.focus();
}  

function getPartnerCode()
{
    var queryString = window.location.search;
    if ("" != queryString)
    {
        parameters = queryString.slice(1).split("&");
        for (var i=0; i<parameters.length; i++)
            if ("pc=" == parameters[i].substr(0,3))
                return "&" + parameters[i];
    }
    return "";
}
      
function openImageGallery(id, pos)
{
    var popup = window.open("../anzeige/pgShowGallery.aspx?id=" + id + "&pos=" + pos + getPartnerCode(), '_blank', 'height=630, width=680, top=100, left=100, channelmode=0, directories=0, fullscreen=0, location=0, menubar=0, resizable=0, scrollbars=0, status=0, titlebar=0, toolbar=0');
    popup.focus();
}

function openHypoRechner(link, target)
{
    var preis = document.getElementById(tbKaufpreis);
    if (preis)
        link = link.replace("%24PREIS%24", preis.value);
    else
        link = link.replace("%24PREIS%24", "");
    
    var popup = window.open(link, target, '');
    popup.focus();
    
    return false;
}

function openAGB(pc)
{
    var popup = window.open("pgAGB.aspx?pc=" + pc, '_blank', 'height=600, width=605, top=100, left=100, channelmode=0, directories=0, fullscreen=0, location=0, menubar=0, resizable=1, scrollbars=1, status=0, titlebar=0, toolbar=0');
    popup.focus();
} 
