function openWin(doc,width,height)
{
      	win=window.open(doc,"","screenX="+width+",screenY="+height+",scrollbars=1,resizable=1,width="+width+",height="+height+",status=0,toolbar=1,menubar=0");
      	win.focus();
}

function SetFocus(elementId)
{
    var element = document.getElementById(elementId);
    element.focus();
}

function CreateBanner(BannerId1, BannerId2)
{
    document.write('<scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn|3.0|83|'+BannerId1+'|0|'+BannerId2+'|ADTECH;loc=100;target=_blank;key=key1+key2+key3+key4;grp=[group];misc='+new Date().getTime()+'"></scri'+'pt>');
}

function DisplayAndHide(ShowId, ElementHide)
{
    document.getElementById(ShowId).style.display = 'block';    
    document.getElementById(ElementHide).style.display = 'none';    
}

/**
 * JQuery functions loaded after document is ready
 */
$(window).load(function () {
    
    /**
     * Add toggle functionality to all links with class "mapLink"
     */
    $(".mapLink").click(function(event) {
    
    	// Prevent normal link behaviour
        event.preventDefault();
        
        // Get the map div
        var mapCanvas = $(this).siblings(".map_canvas");
        
        if(mapCanvas.is(":visible")) {
        
          // Hide div
          mapCanvas.fadeOut("slow");
            
        } else {
        
          // Get lat/long from link href
          var geoData = $(this).attr("href").split(",");
          var latitude = geoData[0].trim();
          var longitude = geoData[1].trim();

          var latlng = new google.maps.LatLng(latitude, longitude);
          var myOptions = {
            zoom: 14,
            center: latlng,
            mapTypeId: google.maps.MapTypeId.ROADMAP
          };
          
          // Show the map div. The div must NOT be hidden when the map is loaded,
          // otherwise the map boundaries are messed up.
          mapCanvas.fadeIn("slow");

          // Load the map
          var map = new google.maps.Map(mapCanvas[0], myOptions);
    
          // Create a marker and position it on the map  
          var marker = new google.maps.Marker({  
            position: latlng,  
            map: map  
          });
          

        }

  });
});




