// JavaScript Document

var domainName = 'http://www.outbacksteakhouse.com.au/';


$(document).ready(function(){
	$('.draggable').draggable();

});

$(document).ready(function(){
	if($.browser.msie)
		$('.dlgCenter').css({'width': '630px', 'background' : 'url(' + domainName + 'images/dlgBody.gif) repeat-y top center'});

});


$(document).ready(function(){
	$('img.popup').hover(
		function(e){
			$(this).addClass('hover');
			},
		function(e){
			$(this).removeClass('hover');
			}
	);
});

$(document).ready(function(){
	$('img.bloom').click(function(){
		//alert('You clicked bloom');
		$('.dlgonion').css('visibility','visible');
		
	});
	
	$('img.spoon').click(function(){
		$('.dlgspoon').css('visibility','visible');
		
	});
	
	$('img.jacket').click(function(){
		$('.dlgjacket').css('visibility','visible');
	});
	
	$('img.pepper').click(function(){
		$('.dlgpepper').css('visibility','visible');
	});
	
	$('img.crouton').click(function(){
		$('.dlgcrouton').css('visibility','visible');
	});

});

$(document).ready(function(){
	$('.closebtn').click(function(e){
		$('.dialogWindow').css('visibility', 'hidden');
	});
});

$(document).ready(function(){
	$('.closebtn').hover(
		function(e){
			$(this).addClass('hover');
		},					 
		function(e){
			$(this).removeClass('hover');
		}
	);
});


$(document).ready(function(){
	var bigImg = ['cg_google', 'cg_cow', 'cg_favorite', 'cg_crouton', 'cg_obligated', 'cg_beerappetizer', 'cg_bloom', 'cg_15ways', 'cg_valet', 'cg_replyall', 'cg_badspeller', 'cg_dessert', 'cg_rita', 'cg_lawschool', 'cg_spicy', 'cg_norules'];
						   
	$('.thumb img').hover(function(e){
		var imgPath = $(this).attr('src');
		
		$(this).attr('src', imgPath.replace('cg_off', 'cg_on'));
		var indxImg = $(this).attr('id');
		
		var newBigImg = imgPath.substring(0, imgPath.indexOf('cg_')) + bigImg[indxImg] + '.jpg';
		
		$('#bigImg').attr('src', newBigImg);
		// alert('id: ' + test);
//		switch()
	},
	function(e){
		var imgPath = $(this).attr('src');
		
		$(this).attr('src', imgPath.replace('cg_on', 'cg_off'));
		
		$('#bigImg').attr('src', imgPath.substring(0, imgPath.indexOf('cg_')) +  bigImg[8] + '.jpg');
	});
});

$(document).ready(function(){
	$('#joinclub img').hover(function(){
		$(this).attr('src', domainName + '/images/sidebtn_on_join-the-club.gif').addClass('hover');
	},
									  
	function(){
		$(this).attr('src', domainName + '/images/sidebtn_join-the-club.gif').removeClass('hover');
	});
	
});

function openJoey() {
	window.open(domainName + 'noworrieszone/joeykidscorner/reef-main.html','joeykidscorner','width=700,height=450,location=yes,scrollbars=yes,resizable=yes');
	
}

function getHeight() {
	var h = window.innerHeight;
	var w = window.innerWidth;
	var browser =  navigator.userAgent.toLowerCase();
	
	if(browser.indexOf('gecko') > -1) {
		$('#joinclub').css('top', h/2 + 'px');

	}
	else {
		var hie = document.documentElement.clientHeight;
		$('#joinclub').css('top', hie / 2.5 + 'px');
	}
}


function jump(){
	location= domainName + 'index.php/' + document.jump_form.locations.options[document.jump_form.locations.selectedIndex].value;
}

