// JavaScript Assests
var $j = jQuery.noConflict();

$j(document).ready(function()
{
	// Drop down menu 
	$j('#sites').clickMenu();
	
	// Clear Search Field
	$j('#search-field').mouseover (function()
	{
		if (this.value=='Search Waiwera.....') { this.value='';return true;}
	});
	$j('#search-field').mouseout (function()
	{
		if (this.value=='') { this.value='Search Waiwera.....';return true;}
	});
	
	// Animations
	$j('#whatson-window').cycle({ 
    	fx:    'scrollLeft', 
    	delay:   -3000,
		pause:   1
	});
	
	$j('#image-slider').cycle({ 
    	fx:'fade', 
    	speed: 4900,
		delay:  -3000,
		random:1
	 });
	
	$j('#scroll-stream').cycle({ 
		fx:     'scrollDown', 
		timeout: 6000, 
		delay:  -3000 ,
		cleartypeNoBg: true,
		pause:   1
	});
	
	// Scroll to the top
	$j(".totop").click(function(){ 
		$j('body, html').animate({scrollTop:0}, 'slow'); 
		return false;
	}); 
	
	// Pop ups
	$j("a[rel^='prettyPhoto']").prettyPhoto({
				animationSpeed: 'normal',
				padding: 40, 
				opacity: 0.6, 
				showTitle: true, 
				allowresize: true, 
				counter_separator_label: '/', 
				theme: 'dark_rounded', 
				callback: function(){}
	});
	
	// add class to remove bottom border on article lists and faq lists
	$j("#article-block-list .fontpage-article:last").addClass("last");
	
	// Movie Ajax Loading
	$j("#main-movies").click( function () {
		location.reload(); 
		return false;
	});
	
	var $jmoviecontent = $j('#movie-content');
	
	$j("#monday-link").click( function () {
		$jmoviecontent.html('<p><img src="images/img/ajax-loader.gif" alt="loading" /></p>').fadeOut("slow");
		$jmoviecontent.load("movies/monday.html").hide().fadeIn("slow");
		return false;
	});
	$j("#tuesday-link").click( function () {
		$jmoviecontent.html('<p><img src="images/img/ajax-loader.gif" alt="loading" /></p>');
		$jmoviecontent.load("movies/tuesday.html").hide().fadeIn("slow");
		return false;
	});
	$j("#wednesday-link").click( function () {
		$jmoviecontent.html('<p><img src="images/img/ajax-loader.gif" alt="loading" /></p>');
		$jmoviecontent.load("movies/wednesday.html").hide().fadeIn("slow");
		return false;
	});
	$j("#thursday-link").click( function () {
		$jmoviecontent.html('<p><img src="images/img/ajax-loader.gif" alt="loading" /></p>');
		$jmoviecontent.load("movies/thursday.html").hide().fadeIn("slow");
		return false;
	});
	$j("#friday-link").click( function () {
		$jmoviecontent.html('<p><img src="images/img/ajax-loader.gif" alt="loading" /></p>');
		$jmoviecontent.load("movies/friday.html").hide().fadeIn("slow");
		return false;
	});
	$j("#saturday-link").click( function () {
		$jmoviecontent.html('<p><img src="images/img/ajax-loader.gif" alt="loading" /></p>');
		$jmoviecontent.load("movies/saturday.html").hide().fadeIn("slow");
		return false;
	});
	$j("#sunday-link").click( function () {
		$jmoviecontent.html('<p><img src="images/img/ajax-loader.gif" alt="loading" /></p>');
		$jmoviecontent.load("movies/sunday.html").hide().fadeIn("slow");
		return false;
	});
	
	if($j("#close-warning")) {
		$j("#close-warning").click( function () {
			$j("#ie6-upgrade").css({'display' : 'none'});								 
			return false;								 
		});
	}
	$j("#content-frame img").wrap('<span class="content-image"></span>');

	// Email Converter
// Email Converter
	$j('a.email').each(function(){
			e = this.rel.replace('/','@');
			this.href = 'mailto:' + e; $j(this).text(e);
	});


	
/*	$j(".jquerycssmenu ul li ul").wrap("<div class='wrap1'><div class='wrap2'>" +
     "<div class='wrap3'></div></div></div>");
*/	
});