function over(id)
{  
	document.getElementById(id).style.backgroundImage="url(template/module/menuv/images/menu_active.gif)";
}
function out(id)
{  
	document.getElementById(id).style.backgroundImage="url(template/module/menuv/images/menu_inactive.gif)";
}
function check_mail_fields()
{
   if (document.contact.vname.value == "" ||
       document.contact.nname.value == "" ||
       document.contact.strasse.value == "" ||
       document.contact.plz.value == "" ||
       document.contact.ort.value == "" ||
       document.contact.telefon.value == "" ||
       document.contact.msg.value == "" ||
       document.contact.email.value == "")
   {
      alert("Sie müssen alle mit einem '*' markierte Felder ausfüllen.");
      return false;
   }
   return true;
}

function check_secpack_fields()
{
   if (document.contact.firma.value == "" ||
       document.contact.name.value == "" ||
       document.contact.strasse.value == "" ||
       document.contact.plz.value == "" ||
       document.contact.ort.value == "" ||
       document.contact.email.value == "")
   {
      alert("Sie müssen alle mit einem '*' markierte Felder ausfüllen.");
      return false;
   }
   return true;
}
function check_orderog_fields()
{
   if (document.contact.firma.value == "" ||
       document.contact.name.value == "" ||
       document.contact.strasse.value == "" ||
       document.contact.plz.value == "" ||
       document.contact.ort.value == "" ||
       document.contact.telefon.value == "" ||
       document.contact.email.value == "" ||
	   (document.contact.produkt[0].checked == false &&
	   document.contact.produkt[1].checked == false))
   {

      alert("Sie müssen alle mit einem '*' markierte Felder ausfüllen.");
      return false;
   }
   return true;
}
function show_map(id, sid)
{
   var breite = 800
   var hoehe = 600

   fenster=window.open ("module/googlemaps/showmap.php?id="+id+"&w=y&sid="+sid,"","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+breite+",height="+hoehe);
   fenster.moveTo(((screen.availWidth-breite)/2),((screen.availHeight-hoehe-100)/2))
}

function show_route(id, sid, error)
{
	var breite = 800
	var hoehe = 600

	from = document.adresse.from.value;
   
	if (document.adresse.from.value == "")
	{
		alert(error);
		return false;
	}
	else
	{
		fenster=window.open ("module/googlemaps/showmap.php?id="+id+"&w=y&route=y&from="+from+"&sid="+sid,"","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+breite+",height="+hoehe);
		fenster.moveTo(((screen.availWidth-breite)/2),((screen.availHeight-hoehe-100)/2))
	}
}
function show_print(id, sid)
{
	var breite = 800
	var hoehe = 600

	fenster=window.open ("module/docsites/print.php?cs="+id+"&sid="+sid,"","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+breite+",height="+hoehe);
	fenster.moveTo(((screen.availWidth-breite)/2),((screen.availHeight-hoehe-100)/2))
}

function show_company_route(id, sid, error)
{
	var breite = 800
	var hoehe = 600

	from = document.route.from.value;
   
	if (document.route.from.value == "")
	{
		alert(error);
		return false;
	}
	else
	{
		fenster=window.open ("module/companysites/route.php?cid="+id+"&w=y&route=y&from="+from+"&sid="+sid,"","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+breite+",height="+hoehe);
		fenster.moveTo(((screen.availWidth-breite)/2),((screen.availHeight-hoehe-100)/2))
	}
}

function show_route2(tar, sid, error)
{
	var breite = 800
	var hoehe = 600

	from = document.route.from.value;
   
	if (document.route.from.value == "")
	{
		alert(error);
		return false;
	}
	else
	{
		fenster=window.open ("module/routeform/route.php?target="+tar+"&w=y&route=y&from="+from+"&sid="+sid,"","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+breite+",height="+hoehe);
		fenster.moveTo(((screen.availWidth-breite)/2),((screen.availHeight-hoehe-100)/2))
	}
}

function show_bigger(file,w,h)
{

   var breite = w
   var hoehe = h
   fenster=window.open (file,"","toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width="+breite+",height="+hoehe);
   fenster.moveTo(((screen.availWidth-breite)/2),((screen.availHeight-hoehe-100)/2))
}

function anzeigen(show)
{ 
	var a = show.split(",");
	for (var i = 0; i < a.length; ++i)
	{
		var b = a[i].split("-");
		
		if(document.getElementById(b[0]))
			document.getElementById(b[0]).style.display=b[1];
	}	
}
function ShowLength(text, field, max)
{
	var x = document.getElementById(field).value;
	if( x.length > max ) x = x.substring( 0, max );
	document.getElementById(field).value = x;
	document.getElementById(text).innerHTML = max-x.length;
} 

function show_image(link, width, height)
{
   var breite = width;
   var hoehe = height;

   fenster=window.open (link,"","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+breite+",height="+hoehe);
   fenster.moveTo(((screen.availWidth-breite)/2),((screen.availHeight-hoehe-100)/2))
}
function show_image2(id)
{
	if(	document.getElementById(id).style.display=='none')
		document.getElementById(id).style.display='block';
	else
		document.getElementById(id).style.display='none';
}
function count(e, textarea, showl, maxl) {
	if (!e.which) keyCode = event.keyCode; // ie5+ op5+
	else keyCode = e.which; // nn6+

	if (document.getElementById(textarea).value.length<maxl+1)
	    document.getElementById(showl).value = maxl-document.getElementById(textarea).value.length;
	else {
	  document.getElementById(textarea).value = document.getElementById(textarea).value.substring(0,maxl);
	  document.getElementById(showl).value = 0;
	}
}
function showBigPic(header, txt) {

    var options = {
        animate:    true,
        displayNav: true
    };

	Shadowbox.open({
        player:  'img',
        content: txt,
        title: header
    }, options);
}

function reloadCaption(delay) {
	
	intervalID = setInterval(load_caption, 10000);
	
}
