jQuery(document).ready(function() {

  jQuery("#layer #arrow").toggle(function(){
      jQuery("#layer").animate( { left:"-=269px"}, { duration: "medium" });
      jQuery("#arrow").css({backgroundImage: "url(/images/bg/arrow_right.gif)"});
    },
    function () {
      jQuery("#layer").animate( { left:"+=269px"}, { duration: "medium" });
      jQuery("#arrow").css({backgroundImage: "url(/images/bg/arrow_left.gif)"});
    }
  );
  
  // Zählpixel für Download Tracks
  jQuery(".cntdownload").click(function () { 
    var cntid = jQuery("#cntdownload").attr("cntid");
    jQuery("#pixel").load("http://www.tourwerk.com/trackdowncnt/" + cntid);
  });

});

function init()	{
/*
    var gesBreite = jQuery("body");
    neueBreite = gesBreite.width();
    if (neueBreite < 1000) neueBreite = 1000;
    jQuery("#map").width(neueBreite-168);
    var gesHoehe = jQuery("body");
    neueHoehe = gesHoehe.height() - 309;//200
    if (neueHoehe < 309) neueHoehe = 309;
    jQuery("#map").height(neueHoehe); 
    jQuery("#layer").height(neueHoehe);  
    jQuery("#layertext").height(neueHoehe-50); 

    
 var gesHoehe = jQuery("body");
//alert(gesHoehe.height());
       neueHoehe = gesHoehe.height() - 309;
       if (neueHoehe < 309){
	 neueHoehe = 500;
	}
	else {
	neueHoehe = 700;

	}
       jQuery("#layer").height(neueHoehe);  
       jQuery("#layertext").height(neueHoehe-50); 
*/	
}

function msgBox(url, text) 
{ 
	var box=window.confirm(text);
	if(box==true){ 
		window.location.href = url; // wenn OK gedrueckt wird. 
	} 
	else if(box==false){ 
		return false;
	} 
} 


function route_uebernehmen($maproute){
	//alert($maproute);
	var data_json = document.getElementById("tourwerk_track_data_json");
	data_json.value = $maproute;
}

	
window.onresize = init;
window.onload = init;