$(document).ready(function(){
$("#fadeDiv").fadeOut(2000);

//if( jQuery.isFunction(jQuery.fn.inFieldLabels) ){
//$("p.label label").inFieldLabels({fadeOpacity:0});
//}
$("#poplang a").click(function(e){
e.preventDefault();
$("#poplang a img").css("opacity","0.5");
$(this).children("img").css("opacity","1");
$.get("/&lang="+$(this).attr("rel")+"");
})
	// needed due to fade in bug on first hover
$("#menu1hov").fadeOut(0);
$("#menu2hov").fadeOut(0);
$("#menu3hov").fadeOut(0);
$("#menu4hov").fadeOut(0);
$("#menu5hov").fadeOut(0);
    $("#menu6hov").fadeOut(0);
//pop-up select

	// top nav
$("#menu1").hover(function () {
$("#menu1hov").fadeIn("slow").css("visibility","visible");
   },
        function () {
    $("#menu1hov").fadeOut("normal");
        });
$("#menu2").hover(function () {
    $("#menu2hov").fadeIn("slow").css("visibility","visible");
        },
        function () {
    $("#menu2hov").fadeOut("normal");
        });
$("#menu3").hover(function () {
    $("#menu3hov").fadeIn("slow").css("visibility","visible");
        },
        function () {
    $("#menu3hov").fadeOut("normal");
        });
$("#menu4").hover(function () {
    $("#menu4hov").fadeIn("slow").css("visibility","visible");
        },
        function () {
    $("#menu4hov").fadeOut("normal");
        });

$("#menu5").hover(function () {
    $("#menu5hov").fadeIn("slow").css("visibility","visible");
        },
        function () {
    $("#menu5hov").fadeOut("normal");
        });
	 $("#menu6").hover(function () {
    $("#menu6hov").fadeIn("slow").css("visibility","visible");
        },
        function () {
    $("#menu6hov").fadeOut("normal");
        });

	// pop-up

$("#city").change(function(){
$.get("/scripts/getstreets.php", { city: $(this).val()},
   function(data){
     $("#streetsSelected").html(data);
   });
$.get("/scripts/gettariff.php", { city: $(this).val()},
   function(data){
     $("#tariffs").html(data);
   });
});

$("#streetsSelected").change(function(){
$.get("/scripts/getbuildings.php", { street: $(this).val(), city: $("#city").val()},
   function(data){
     $("#build").html(data);
   });
});
	
});
