$(document).ready(function(){
            //var current_id=null;    
            jQuery(".prev_car_small img").hover(
		function (){
              
			var srcpath=$(this).attr("src");
			srcpath=srcpath.replace('thumb_','gray_');
			jQuery("#card_holder img").attr("src", srcpath );
			jQuery("#gray_box_info_text").attr("style","display:none;")
		},
		function (){
			jQuery("#card_holder img").attr("src", '/kathan_datenbank/images/vorteilskarte-1.jpg' );
			jQuery("#gray_box_info_text").attr("style","")
		}
	    
	    );
            var $scrollingDiv = $("#gray_box_info");
 
            $(window).scroll(function(){
		 var po=$(window).scrollTop() ;
		 if(po>170)po=po-170;
                   $scrollingDiv
                          .stop()
			  
                          .animate({"marginTop": (po + 120) + "px"}, "slow" );
            });
	    jQuery(".navi_image_item img").hover(
		function (){
              
			var srcpath=$(this).attr("src");
			srcpath=srcpath.replace('detail_thumb_','gray_');
			jQuery("#big_image img").attr("src", srcpath );
			
		}
		
	    
	    );

	});
 
function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

//var host="/fahrzeugangebot/gebrauchtwagen-gesamt.html";
var host="";
function onOptionUpdateMa(tok,news_id){
	//alert('test');
	
	var marke = marke=document.getElementById("marke").value;
	window.location.href=host+'?p=1&ma='+marke+'&tok='+tok+'&n='+news_id;
};
function onOptionUpdateRe(tok,news_id){
	//alert('test');
	var reihe=reihe=document.getElementById('reihe').value;
	
	var marke = marke=document.getElementById("marke").value;
	window.location.href=host+'?p=1&ma='+marke+'&r='+reihe+'&tok='+tok+'&n='+news_id;
};
function onOptionUpdateMo(tok,news_id){
	//alert('test');
	var reihe=reihe=document.getElementById('reihe').value;
	var modell=document.getElementById('modell').value;
	var marke = marke=document.getElementById("marke").value;
	window.location.href=host+'?p=1&ma='+marke+'&r='+reihe+'&mo='+modell+'&tok='+tok+'&n='+news_id;
};