
 
 $(document).ready(function(){
gettext(postnr); 

 $(".kattozip").hover( function () {
	 
	 $(this).css('cursor', 'pointer'); 
	
	 $(this).css('border', '2px solid green'); 
	 //$("#right").html('test'); 
	 }, 
	 
	 function ()
	 {
	  $(".kattozip").css('border', '2px solid white')
	 }
	 ); 



$("#postnrcity").blur(function() { 
    if($(this).val() != '') { 
        // unhighlight textarea 
        // hide "add" button 
				gettext($(this).val());
    } 
}); 

$(".kattozip").click(function (event) {
    $('html, body').animate({scrollTop:0}, 'fast');  

   
	event.preventDefault();

		mykat=$(this).attr('id') 
		mykat2=$(this).attr('id2') 
		
		  mykat2=mykat2;
	mykat2=mykat2.replace("æ", "ae");
  mykat2=mykat2.replace("å", "aa")
	mykat2=mykat2.replace("Å", "aa")
 
	mykat2=mykat2.replace("Ø", "oe")



		
		
 
   
	 $('body').append($('<div id=popup class=popup><div class=supersearch id=popupframe style=\"font-size:22px;background:white;width:500px;height:300px;padding:0px;padding-top:0px;position:absolute;margin: 20% 20% 20% 30%;border:5px solid #f34607; \"><div  id=popupclose style=\"font-size:22px;width:500px;height:20px;padding:0px;padding-bottom:3px;position:relative;top:0px;margin: 0px auto 0px auto;border:0px solid black;color:white;background:#444444;text-align:right; \">LUK VINDUET</div><div id=popup2></div>'));
	 $("#popupclose").hover( function () {
	 
	 $(this).css('cursor', 'hand'); 
	 
	 }); 
	 
	 
	 $("#popupclose").click( function () {

	$("#popup").remove(); 
	
	}); 
    
		//alert(mykat2 + " "+ mykat); 
		
		
		
$('#popup2').html('Indtast dit postnr - s&aring; finder vi<br><br> <h1 style=font-size:32px;>'+ mykat2 +'</h1><br><br> t&aelig;ttest p&aring; dig!<br><br> Indtast dit postnr : <input type=\"text\" id=\"postnr2\" size=4 maxlenght=4 style=\"font-size:22px\">&nbsp;<input type=\"hidden\" value=\"'+mykat+'\" id=\"kategori2\"><input type=\"button\" style=\"font-size:22px;color:white;background:green\" value=\"s&oslash;g\" id=\"searchbutton2\"><br><a href=\"http://www.udlejergruppen.dk/kategori/'+mykat+'/\">Klik  Her for at vise alle i hele landet.</div> </div>');
	 
		$("#postnr2").focus(); 
		
		$("#searchbutton2").click ( function () {
	url="/kategori/"+document.getElementById('kategori2').value+"/"+escape(document.getElementById('postnr2').value)+"/";
document.location=url;
		}); 
			
		
		}); 
		

	

 }); // document.ready

function zipandkat () 
{

}


 	function gettext (zip){


$.getJSON("http://www.udlejergruppen.dk/phpjson/JSON_ziptocity.php?postnr="+zip+"&jsoncallback=?",{
 			});
		
 } // gettext 
 


 
 





function showcity(data){

			 if (data!=null) {

  for (i = 0; i < data.length; i++) {
  bynavn=data[i].bynavn;
	bynavn=bynavn.replace("æ", "ae");
  bynavn=bynavn.replace("å", "aa")
	bynavn=bynavn.replace("Å", "aa")
  bynavn=bynavn.replace("ø", "oe")
	bynavn=bynavn.replace("Ø", "oe")
	bynavn=bynavn.replace(" ", "-")

 $("#showcity").html("  "+data[i].bynavn+"");
 $("#hiddencityname").val(bynavn);
 }
}

			 } // end function 
			



<!--




function showProgress() {

    var pb = document.getElementById("loader"); 
    pb.innerHTML = 'Søger!'; 
    pb.style.display = ''; 
} 




function findprod()
{



if (document.getElementById('kategori').value!='')
{
altok='ok';

}
if (document.getElementById('kategori').value=='')
{
altok='nej';
document.getElementById('kategori').focus();
}

if (altok=='ok') 
{


if (document.getElementById('hiddencityname').value!='')
{

//showProgress(); 
//url="/til-leje/"+document.getElementById('produktkat').value+"/"+escape(document.getElementById('hiddencityname').value)+"/390/side-1.html";
url="/kategori/"+document.getElementById('kategori').value+"/"+escape(document.getElementById('postnrcity').value)+"/";
document.location=url;

}
else
{

document.getElementById('postnrcity').focus();
 $("#showcity").html("Mangler postnr! ");
}

}

}
//-->


