
//_uacct = "UA-129688-1";
//urchinTracker();


var lastid="";
var reactivate_id=1;
var repeatx=0;

function show_submenu(id)
{
	reactivate_id++;
		
	if(document.getElementById("submenu"+lastid)!=null)
	{
		document.getElementById("submenu"+lastid).style.display = "none";
	}
	
	lastid=id;

	if(document.getElementById("submenu"+id)!=null)
	{
		document.getElementById("submenu"+id).style.display = "block";
	}

	if(document.getElementById("submenuact")!=null)
	{
		document.getElementById("submenuact").style.display = "none";
	}
}


function reactivate_act2(reactivate)
{

	if(reactivate==reactivate_id)
	{

		if(repeatx==1)
		{
			reactivate_id++;
			window.setTimeout("reactivate_act2("+reactivate_id+")",1000);
		}
		else
		{
			if(document.getElementById("submenu"+lastid)!=null)
			{
				document.getElementById("submenu"+lastid).style.display = "none";
			}
			if(document.getElementById("submenuact")!=null)
			{
				document.getElementById("submenuact").style.display = "block";
			}
		}
	}
}

function reactivate_act()
{
	if(document.getElementById("submenu"+lastid)!=null)
	{
		document.getElementById("submenu"+lastid).style.display = "none";
	}
	if(document.getElementById("submenuact")!=null)
	{
		document.getElementById("submenuact").style.display = "block";
		//document.getElementById("current2").style.display = "";
	}
	reactivate=0;
}


function reactivate_act_timer()
{
	window.setTimeout("reactivate_act2("+reactivate_id+")",1000);
}


function repeat_true()
{
	repeatx=1;
}


function repeat_false()
{
	repeatx=0;
}







/*
var ids=Array();
var hasFocus=new Array();
var hasMouseover=new Array();

function showBg(id)
{
	if(hasFocus[id]==0&&hasMouseover[id]==0&&document.getElementById(id).value=="")
	{
		document.getElementById(id).style.backgroundImage="url(/fileadmin/templates/template_pics/suche.gif)";
	}
	else
	{
		document.getElementById(id).style.backgroundImage="none";
	}
}


function initId(id)
{
	for (var i = 0; i < ids.length; i++)
	{
		if(ids[i]==id)
		{
			return;
		}
	}
	
	hasFocus.push(0);
	hasMouseover.push(0);
	ids.push(id);
}

function showBgFocus(id)
{
	initId(id);
	hasFocus[id]=0;
	showBg(id);
}

function showBgMouseover(id)
{
	initId(id);
	hasMouseover[id]=0;
	showBg(id);
}

function hideBgFocus(id)
{
	initId(id);
	hasFocus[id]=1;
	showBg(id);
}

function hideBgMouseover(id)
{
	initId(id);
	hasMouseover[id]=1;
	showBg(id);
}


*/

var googlemapshow=false;

var map;
var geocoder;




function load()
{
	if (GBrowserIsCompatible()) 
	{
		var geocoder = new GClientGeocoder();
		var map = new GMap2(document.getElementById("googlemap"));
		//map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		//map.addControl(new GScaleControl());
		map.addControl(new GLargeMapControl());

		
		map.setCenter(new GLatLng(47.38359, 8.542686), 15);



	  map.clearOverlays();
	  var address="Sumatrastrasse 25, Zürich";
	  var response=geocoder.getLatLng(
		address,
		function(point) {
		  if (!point) {
			
		  } else {
			map.setCenter(point, 15);
			var marker = new GMarker(point);
			map.addOverlay(marker);
			marker.openInfoWindowHtml("<a href='http://www.zimtkorn.ch' style='background-color:transparent;'><img src='fileadmin/templates/template_pics/logo2.gif' alt='Zimtkorn Logo'/></a><br/><b>zimtkorn ag</b><br/>Sumatrastrasse 25<br/>8006 Zürich<br/><br/>");

			  GEvent.addListener(marker, "click", function() {
				marker.openInfoWindowHtml("<a href='http://www.zimtkorn.ch' style='background-color:transparent;'><img src='fileadmin/templates/template_pics/logo2.gif' alt='Zimtkorn Logo'/></a><br/><b>zimtkorn ag</b><br/>Sumatrastrasse 25<br/>8006 Zürich<br/><br/>");
			  });

		  }
		}
	  );




	}
}

function myonload_function()
{

	try {
		var pageTracker = _gat._getTracker("UA-9650032-1");
		pageTracker._trackPageview();
	} catch(err) {}
	
	if(document.getElementById('interduction').innerHTML=="")
	{
		document.getElementById('interduction').style.display="none";
	}

	try
	{
		//if site requiers googlemaps
		if(googlemapshow)
		{
			load();
		}
	}
	catch (ex)
	{
	}

}

//window.captureEvents(Event.LOAD);
//window.onload = myonload_function;

function myunload_function()
{
	try
	{
		GUnload();
	}
	catch (ex)
	{
	}
}


//window.captureEvents(Event.UNLOAD);
//window.unload = myunload_function;









function update_auswahl()
{
	//var kategorieAuswahl = document.forms.refdropdown.branche;
	var kategorieAuswahl = document.getElementById('branchedropdown');
	//var unterkategorieAuswahl = document.forms.refdropdown.unterkategorie;
	//unterkategorieAuswahl.options.length = 0; // DropDown Menü entleeren

	var site = kategorieAuswahl.selectedIndex;
	window.location.href = '/kunden/#'+kategorieAuswahl.options[kategorieAuswahl.selectedIndex].value;
	//window.location.href = window.location.href+'#'+kategorieAuswahl.options[kategorieAuswahl.selectedIndex].value;

	/*if (kategorieAuswahl.options[kategorieAuswahl.selectedIndex].value == "Email")
	{
		unterkategorieAuswahl.options[0] = new Option("Software");
		unterkategorieAuswahl.options[1] = new Option("Anbieter");
	}
	else if (kategorieAuswahl.options[kategorieAuswahl.selectedIndex].value == "Internet")
	{
		unterkategorieAuswahl.options[0] = new Option("Internetzugang");
		unterkategorieAuswahl.options[1] = new Option("Webseiten erstellen");
	}*/
}



function hide_dropdown()
{
	document.getElementById('project_references_dropdown').style.display="none";
}