﻿
function fnClickOK(sender, e) {
    __doPostBack(sender, e);
}

function openPopupShare()
{
    var popupShare = window.open("Share.aspx", "Weiterleiten", "width=580,height=600,left=200,top=100");
    //screen.width
    //screen.height
    // Ziel --> popShare zentral positionieren
    popupShare.focus();
}

function openPopupRate() {
    var popupShare = window.open("Rate.aspx", "Weiterleiten", "width=580,height=600,left=200,top=100");
    //screen.width
    //screen.height
    // Ziel --> popShare zentral positionieren
    popupShare.focus();
}

function openShare() 
{
    $find('ctl00_ContentPlaceHolder1_ModalPopupExtenderShare').show();
}

function openFeedback() {
    $find('ctl00_ContentPlaceHolder1_ModalPopupExtenderFeedback').show();
}


// Google Maps

function showMap(latitude, longitude, zoom, dest, customerName, logo) 
{
    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById('ctl00_ContentPlaceHolder1_map_canvas'));
        map.setCenter(new GLatLng(latitude, longitude), 15);
        map.setUIToDefault();
        var marker = new GMarker(new GLatLng(latitude, longitude));
        GEvent.addListener
            (marker, 'click',
                function() {
                    map.openInfoWindowHtml(new GLatLng(latitude, longitude),
                    bubbleContent(latitude, longitude, logo, customerName, dest))
                }
             );

        map.addOverlay(marker);
        map.openInfoWindowHtml(new GLatLng(latitude, longitude),
                                    bubbleContent(latitude, longitude, logo, customerName, dest));

    }

}

function showLocation(showBubbleOnInit, latitude, longitude, zoom, dest, customerName, logo) {
        map.setCenter(new GLatLng(latitude, longitude), zoom);
        map.setUIToDefault();
        var marker = new GMarker(new GLatLng(latitude, longitude));
        GEvent.addListener
            (marker, 'click',
                function() {
                    map.openInfoWindowHtml(new GLatLng(latitude, longitude),
                    bubbleContent(latitude, longitude, logo, customerName, dest))
                }
             );

        map.addOverlay(marker);

        if (showBubbleOnInit == 1) 
        {
            map.openInfoWindowHtml(new GLatLng(latitude, longitude),
                                    bubbleContent(latitude, longitude, logo, customerName, dest));
        }
    

}



function bubbleContent(latitude, longitude, logo, customerName, destination) 
{
    return '<div style="float:left;margin:5px;">' +
                    '<img width="100" src="' + logo + '"/></div>' +
                    '<div style="align:right;">' +
                     unescape(customerName) + '</br><a href="http://www.google.com/maps?source=uds&daddr=' + destination + '@' + latitude + ',' + longitude + '"' +
                    ' target="_blank">Routenplanung</a></div>';
}


function showBild(index) {
    bilderAktuell = index;
    $find('ctl00_ContentPlaceHolder1_ModalPopupExtenderGallerie').show();
    document.getElementById('meinBild').src = bilderArray[bilderAktuell];
   
}

function bildVor() 
{
    bilderAktuell++;

    if (bilderAktuell > bilderAnzahl -1) {
        bilderAktuell = 0;  
    }

    showBild(bilderAktuell);
}

function bildZurueck() 
{
    bilderAktuell--;

    if (bilderAktuell < 0) {
        bilderAktuell = bilderAnzahl - 1;
    }

    showBild(bilderAktuell);
}


