		var hostName = "http://"+location.host+"/quotes/index";
		var id = "";
		
		$(window).scroll(function (){ 
      		//$(id).css("top", getScrollY() + ($(window).height()/2-$(id).height()/2));
      		//alert(id.length);
      		if (id.length>0)
      		{
      			$(id).animate({ 
           			top: getScrollY() + ($(window).height()/2-$(id).height()/2),
				}, 50, "linear");
			}
		});
		
		$("a.popup").click(function(e) {
			id = $(this).attr('href');
			e.preventDefault();
			$("#poppup").empty();
			$("#poppup").load( hostName , {} , optionsLoaded_interes );
		});
		
		function optionsLoaded_interes()
		{
			//Set heigth and width to mask to fill up the whole screen
			var maskHeight = $(document).height();
			var maskWidth = $(window).width();
			$('#mask').css({'width':maskWidth,'height':maskHeight});
			
			//transition effect		
			$('#mask').fadeIn(200);	
			$('#mask').fadeTo("fast", 0.8);	
			
			//Get the window height and width
			var winH = $(window).height();
			var winW = $(window).width();
			
			//Set the popup window to center
			$(id).css('top', getScrollY() + (winH/2-$(id).height()/2));
			$(id).css('left', winW/2-$(id).width()/2);
			
			//transition effect
			$(id).fadeIn(200); 
		}
		
		
		function getScrollY() 
		{
    		scrollY = 0;    
    		if (typeof window.pageYOffset == "number") {
        		scrollY = window.pageYOffset;
    		} else if (document.documentElement && document.documentElement.scrollTop) {
        		scrollY = document.documentElement.scrollTop;
    		}  else if (document.body && document.body.scrollTop) {
        		scrollY = document.body.scrollTop; 
    		} else if (window.scrollY) {
        		scrollY = window.scrollY;
    		}
    		return scrollY;
		}