function nextpic(img)
{$('img#fhzpic').attr('src', img);}
function addToBookmarks(url,title) {
if (window.sidebar) { // Mozilla Firefox Bookmark		
window.sidebar.addPanel(title, url,"");	
} 
else if( window.external ) 
{ // IE Favorite
		window.external.AddFavorite( url, title); 
    }
    	else if(window.opera && window.print) {
       // Opera Hotlist	
       	return true; } 
         }
      
      
      
      $(document).ready(function() {
  
        
  $(function() {
	$('a.lightbox').lightBox();
});
 
 
 $(function() {
	$('a.lightbox2').lightBox();
});
 
      });

  
      
         
        
         
function openSub(id)
{$('#carmenue_'+id).toggle();}

 jQuery(function() {
 
 	 //show a simple loading indicator
	var loader = jQuery('<div id="loader"><img src="/system/img/ajax-loader.gif"></div>')
		.css({position: "relative", top: "2em"})
		.appendTo("#kform")
		.hide();
 
		jQuery().ajaxStart(function() {
			loader.show();
		}).ajaxStop(function() {
			loader.hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		});
		var v = jQuery("#kontaktform").validate({
			submitHandler: function(form) {
      	jQuery(form).ajaxSubmit({
					target: "#kform"
				});
			}
		});
	});
	
	
	//Suchauftrag
jQuery(function() {
		// show a simple loading indicator
//		var loader = jQuery('<div id="loader">wird geladen...</div>')
	//		.css({position: "relative", top: "1em", left: "25em"})
	//		.appendTo("body")
	//		.hide();
		jQuery().ajaxStart(function() {
		//	loader.show();
    }).ajaxStop(function() {
	//		loader.hide();
			$("#suchaufhead").hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		});
		var v = jQuery("#suchauftragform").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#suchauftragform"
				});
      }
    });
	});


//COOKIE 

function setfhz(titel,fhz){
//alert($.cookie(titel));
if( $.cookie(titel))
{
//alert($.cookie(titel));
var visited = ($.cookie(titel) || "").split('-');
//alert(visited);
visited.push(fhz);
$.cookie(titel, visited.join('-'),{path: "/" , expires: 30 });
return;
}

else{$.cookie(titel, fhz ,{ path: "/" , expires: 30 });}
return;
}

function removefhz(titel,fhz){
if( $.cookie(titel)){
var visited= ($.cookie(titel) || "").split('-');
var stack=[];var item='';
$.each(visited, function(index,item)
{if(item != fhz){stack.push(item);}});
$.cookie(titel, stack.join('-'),{ path: "/" , expires: 30 });
return;}}
