/*Scroll to Bottom /*/
$(function(){
                $('a[href*=#]').click(function() {
                if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
                    && location.hostname == this.hostname) {
                        var $target = $(this.hash);
                        $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
                        if ($target.length) {
                            var targetOffset = $target.offset().top;
                            $('html,body').animate({scrollTop: targetOffset}, 1500);
                            return false;
                        }
                    }
                });            
            });
/*====================== SCrollTOp ======================*/
 $(document).ready(function(){
		var pxShow = 300;//height on which the button will show
		var fadeInTime = 1000;//how slow/fast you want the button to show
		var fadeOutTime = 1000;//how slow/fast you want the button to hide
		var scrollSpeed = 1000;//how slow/fast you want the button to scroll to top. can be a value, 'slow', 'normal' or 'fast'
		jQuery(window).scroll(function(){
			if(jQuery(window).scrollTop() >= pxShow){
				jQuery("#back-top").fadeIn(fadeInTime);
			}else{
				jQuery("#back-top").fadeOut(fadeOutTime);
			}
		});
		 
		$('#back-top a').click(function(){
			$('html, body').animate({scrollTop:0}, scrollSpeed); 
			return false; 
		}); 		
		
		});

/*====================== Logo Hover ======================*/
$(document).ready(function() {     
 $('li.contact a').hover( function(){
     $('#logo').css('background-position', 'bottom center');
},
function(){
     $('#logo').css('background-position', 'top left');
});
});
function getHeight()
	{
		if($.browser.msie)
			{
			var $temp = $("")
			.css("position","absolute")
			.css("left","-10000px")
			.append($("body").html());
			
			$("body").append($temp);
			var h = $temp.height();
			$temp.remove();
			return h;
		}
	return $("body").height();
}
/*====================== THE LIGHTS ======================*/
$(document).ready(function(){
	$("#the_lights").fadeTo(1,0);
	$(".lightsoff").click(function () {
		$("#the_lights").css("width","100%");
		$("#the_lights").css("height",getHeight()+"px");
		$("#the_lights").css({'display' : 'block'});
		$("#the_lights").fadeTo("slow",1);
	});
	$(".lightssoft").click(function () {
		$("#the_lights").css("width","100%");
		$("#the_lights").css("height",getHeight()+"px");
		$("#the_lights").css("display","block");
		$("#the_lights").fadeTo("slow",0.7);
	});
	$(".lightson").click(function () {
		$("#the_lights").css("width","1px");
		$("#the_lights").css("height","1px");
		$("#the_lights").css("display","block");
		$("#the_lights").fadeTo("slow",0);
	});
});

