var map,accoicon;

function ChangeTabs(Tab)
{
	document.getElementById("tab_1").style.backgroundColor = "#FFFFFF";
	document.getElementById("tab_2").style.backgroundColor = "#FFFFFF";
	document.getElementById("tab_3").style.backgroundColor = "#FFFFFF";
	document.getElementById("tab_4").style.backgroundColor = "#FFFFFF";
	document.getElementById("tab_5").style.backgroundColor = "#FFFFFF";
	document.getElementById("tab_" + Tab).style.backgroundColor ="#21427B";
	
	document.getElementById("tablink_1").style.color ="";
	document.getElementById("tablink_2").style.color ="";
	document.getElementById("tablink_3").style.color ="";
	document.getElementById("tablink_4").style.color ="";
	document.getElementById("tablink_5").style.color ="";
	document.getElementById("tablink_" + Tab).style.color ="#FFFFFF";
}

function ShowBlock (Tab)
{

	document.getElementById("block_details").style.display = 'none';
	document.getElementById("block_packages").style.display = 'none';
	document.getElementById("block_map").style.display = 'none';
	document.getElementById("block_ausstattung").style.display = 'none';
	document.getElementById("block_rooms").style.display = 'none';

	if (Tab==1){ document.getElementById("block_details").style.display = 'block';document.getElementById("accoright").style.display = 'block'; }
	if (Tab==2){ document.getElementById("block_rooms").style.display = 'block';document.getElementById("accoright").style.display = 'block'; }
	if (Tab==3){ document.getElementById("block_packages").style.display = 'block';document.getElementById("accoright").style.display = 'block'; }
	if (Tab==4){ document.getElementById("block_map").style.display = 'block';document.getElementById("accoright").style.display = 'none'; }
	if (Tab==5){ document.getElementById("block_ausstattung").style.display = 'block';document.getElementById("accoright").style.display = 'block'; }
	
	ChangeTabs(Tab);

}
		 	
function LoadMap() {			
	
 	if (GBrowserIsCompatible()) {
       	map = new GMap2(document.getElementById("map"));
       	map.setCenter(new GLatLng(47.500412,12.297702), 10);
      	map.setMapType(G_NORMAL_MAP); 
       	map.addControl(new GLargeMapControl());
   		map.addControl(new GMapTypeControl());
   		
   		// Icons definieren
     	accoicon = new GIcon();
		accoicon.iconSize = new GSize(12, 12);
		accoicon.iconAnchor = new GPoint(5, 5);
		accoicon.image = "/de/images/vermieter/button_point_low.png";	
		accoicon.infoWindowAnchor = new GPoint(5, 5); 		     		
	
		// Punkt hinzufügen
		Addmarker();
		
		//Karte ausblenden
		document.getElementById("block_map").style.display = 'none';
	
	}

}

function Addaccomarker(feratelid, lat, lon, titel, html){
	
	// Marker
	var point = new GLatLng(lat,lon);
	var marker = new GMarker(point,{icon:accoicon,title:titel});
	map.addOverlay(marker); 
	map.setCenter(point, 14);	
	marker.openInfoWindowHtml(html);

	// Infowindow
	GEvent.addListener(marker,'click',
		function(){marker.openInfoWindowHtml(html);});	

}	


function countredirect(feratelid, kampagne, language){
	
	var xmlhttp=null;
	var url = 'http://www.kitzalps.cc/'+ language +'/vermieter/countredirect.asp?FeratelID=' + feratelid;		
	
	if (kampagne != "") {url = url + "&CID=" + kampagne}
	
	if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();} else if (window.ActiveXObject) {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
	  
	if (xmlhttp!=null)
	  {
	 		xmlhttp.open("GET",url,true);	
	 		xmlhttp.send(null); 	  		
	  }	
	
}
