
$(document).ready(function(){
		
		/*****************************
		  jQuery for Map Pages
		  NOTE: jQuery for Map and Sidebar located in mapping-getcenter.js
		*****************************/
		
		$(".sidedays").hide();
		
		
		$(".window_pane").click(function(){
				alert("shit");
		});
		
		$(".listname").click(function(){
				$(this).next(".sidedays").slideToggle();		
		});
		
 		$(".clickday").click(function(){
 				alert("fart");		
 		});
 		
 		$(".viewAllBars").mouseover(function(){
 				$(".viewAllBars").css("background","url(/images/view_all_bars_flag_rollover.png)");
 		});
 		
 		$(".viewAllBars").mouseout(function(){
 				$(".viewAllBars").css("background","url(/images/view_all_bars_flag.png)");
 		});
 		
 		/*****************************
		  jQuery for Day Pages
		*****************************/
		
		$(".rolloutExtra").hide();			
				
			var imgoing = $(".imGoingNumber").html();
			var imgoing = parseInt(imgoing);
			
			var w = $(document).width();
			var h = $(document).height();
			$("#myshadow").css("height", h).css("width", w).css("padding-bottom", "50px");
			
	
	$(".barChange").change(function(){	
			//window.open("/monday-happy-hour-seattle-wa-test.html?barid=2","_self");
			$(".rolloutWrap").hide();				
			var barID = $(this).val();
			if (barID != ""){
					$(".rolloutWrap[name='"+barID+"']").show();
			}else {
				$(".rolloutWrap").show();	
			}
	});
	
	$(".drinkChange").change(function(){
			$(".rolloutWrap").hide();				
			var drinkType = $(this).val();
			$(".rolloutWrap:contains('"+drinkType+"')").show();
	
	});
	
	$(".nextButton").click(function(){
		top = $(".nextButton").scrollTop();
					
	});
	
	$(".imGoing").mouseover(function(){
 				$(".imGoing").css("background","url(/images/im_going_button_roll.png)");
 	});
 		
 	$(".imGoing").mouseout(function(){
 				$(".imGoing").css("background","url(/images/im_going_button.png)");
 	});
 	
 	$(".imGoing").click(function(){
 			$(".imGoingNumber").html(imgoing + 1)
 			

 	});
 	
 	$(".viewAllBarsButton").click(function(){		
 			$(".rolloutWrap").show();		
 	});
 	
 		/*****************************
		  jQuery for Footer
		*****************************/
		
		$(".footerBigLinksHome").mouseover(function(){
				$(".footerBigLinksHome").css("background","url(/images/footer_home_roll.png) no-repeat center");		
		});	
		
		$(".footerBigLinksHome").mouseout(function(){
				$(".footerBigLinksHome").css("background","url(/images/footer_home.png) no-repeat center");		
		});	
		
		$(".footerBigLinksHappyHour").mouseover(function(){
				$(".footerBigLinksHappyHour").css("background","url(/images/footer_happy_hour_roll.png) no-repeat center");		
		});	
		
		$(".footerBigLinksHappyHour").mouseout(function(){
				$(".footerBigLinksHappyHour").css("background","url(/images/footer_happy_hour.png) no-repeat center");		
		});
		
		$(".footerBigLinksDrinkSpecials").mouseover(function(){
				$(".footerBigLinksDrinkSpecials").css("background","url(/images/footer_drink_specials_roll.png) no-repeat center");		
		});	
		
		$(".footerBigLinksDrinkSpecials").mouseout(function(){
				$(".footerBigLinksDrinkSpecials").css("background","url(/images/footer_drink_specials.png) no-repeat center");		
		});	
		
		$(".footerBigLinksContactUs").mouseover(function(){
				$(".footerBigLinksContactUs").css("background","url(/images/footer_contact_roll.png) no-repeat center");		
		});	
		
		$(".footerBigLinksContactUs").mouseout(function(){
				$(".footerBigLinksContactUs").css("background","url(/images/footer_contact.png) no-repeat center");		
		});	
		
		/*****************************
		  jQuery for Happy Hour Drink Specials
		*****************************/
		
		$(".selectorCity").hide();
		$(".selectorCollege").hide();
	
//		$(".selectACityHH").click(function(){
//				$(".selectorCollege").hide();
//				$(".selectorCity").slideToggle("slow");	
//		});
	
		$(".selectACityHH").mouseover(function(){
				$(".selectACityHH").css("background","url(/images/select_a_city_hh_roll.png)")			
		});	
	
		$(".selectACityHH").mouseout(function(){
				$(".selectACityHH").css("background","url(/images/select_a_city_hh.png)")			
		});	
               
        $(".selectACityHH").bind("mouseenter", function(){
                $(".selectorCity").stop(true,true).show();
                $(".selectorCity").bind("mouseenter", function(){
                $(".selectorCity").stop(true,true).show();
                }).bind("mouseleave", function(){
                        $(".selectorCity").hide();
                });
                   
                }).bind("mouseleave", function(){
                		$(".selectorCity").hide();
        });
        		
        $(".selectACollegeHH").bind("mouseenter", function(){
                $(".selectorCollege").stop(true,true).show();
                $(".selectorCollege").bind("mouseenter", function(){
                $(".selectorCollege").stop(true,true).show();
                }).bind("mouseleave", function(){
                        $(".selectorCollege").hide();
                });
                   
                }).bind("mouseleave", function(){
                		$(".selectorCollege").hide();
        });		
               
                
		
//		$(".selectACollegeHH").click(function(){
//				$(".selectorCity").hide();			
//				$(".selectorCollege").slideToggle("slow");	
//		});
	
		$(".selectACollegeHH").mouseover(function(){
				$(".selectACollegeHH").css("background","url(/images/select_a_college_hh_roll.png)")			
		});	
	
		$(".selectACollegeHH").mouseout(function(){
						$(".selectACollegeHH").css("background","url(/images/select_a_college_hh.png)")			
		});	
		
		/*****************************
		  jQuery for Pagination
		*****************************/
		//how much items per page to show  
		var show_per_page = 10;  
		//getting the amount of elements inside content div  
		var number_of_items = $("#rolloutContainer").children().size();
		//calculate the number of pages we are going to have  
		var number_of_pages = Math.ceil(number_of_items/show_per_page);  
		
		//set the value of our hidden input fields  
		$('#current_page').val(0);  
		$('#show_per_page').val(show_per_page);  
		
		 var navigation_html = '<a class="previous_link" href="javascript:previous();">Prev</a> ';  
		 var current_link = 0;  
		 while(number_of_pages > current_link){  
		 		 navigation_html += '<a class="page_link" href="javascript:go_to_page(' + current_link +')" longdesc="' + current_link +'">'+ (current_link + 1) +'</a> ';  
		 		 current_link++;  
		 }
		 navigation_html += ' <a class="next_link" href="javascript:next();">Next</a>';
		 
		 var navigation_html2 = '<a class="previous_link" href="javascript:previous();">Prev</a> ';  
		 var current_link2 = 0;  
		 while(number_of_pages > current_link){  
		 		 navigation_html2 += '<a class="page_link" href="javascript:go_to_page(' + current_link2 +')" longdesc="' + current_link2 +'">'+ (current_link2 + 1) +'</a> ';  
		 		 current_link2++;  
		 }
		 navigation_html2 += ' <a class="next_link" href="javascript:next();">Next</a>';
		 
		 $('.page_navigation').html(navigation_html);
		 $('.page_navigation2').html(navigation_html2);
		 //$('#backtotop').html(navigation_html);
		 
		 //add active_page class to the first page link  
		 $('.page_navigation .page_link:first').addClass('active_page'); 
		 $('.page_navigation2 .page_link:first').addClass('active_page');
		 //$('#page_navigation2 .page_link:first').addClass('active_page');  
		 
		//hide all the elements inside content div  
		$("#rolloutContainer").children().css('display', 'none');  
  
		//and show the first n (show_per_page) elements  
		$("#rolloutContainer").children().slice(0, show_per_page).css('display', 'block');
 		

		$("#backtotop").click(function(){
			window.scrollTo(100,500);
		});

});	
    function previous(){  
      
        new_page = parseInt($('#current_page').val()) - 1;  
        //if there is an item before the current active link run the function  
        if($('.active_page').prev('.page_link').length==true){  
            go_to_page(new_page);  
        }  
      
    }  
      
    function next(){  
        new_page = parseInt($('#current_page').val()) + 1;  
       
        //if there is an item after the current active link run the function  
        if($('.active_page').next('.page_link').length==true){ 
        	
            go_to_page(new_page);  
        }  
      
    }  
    function go_to_page(page_num){  
        //get the number of items shown per page  
        var show_per_page = parseInt($('#show_per_page').val());  
      
        //get the element number where to start the slice from  
        start_from = page_num * show_per_page;  
      
        //get the element number where to end the slice  
        end_on = start_from + show_per_page;  
      
        //hide all children elements of content div, get specific items and show them  
        $("#rolloutContainer").children().css('display', 'none').slice(start_from, end_on).css('display', 'block');  
      
        /*get the page link that has longdesc attribute of the current page and add active_page class to it 
        and remove that class from previously active page link*/  
        $('.page_link[longdesc=' + page_num +']').addClass('active_page').siblings('.active_page').removeClass('active_page');  
      
        //update the current page input field  
        $('#current_page').val(page_num);  
    }  
   




