/*
 *    jQuery control scripts for tasmanleathers.co.nz
 *    
 */
		
$(document).ready(function(){
 		
		// convert our 'rel=' links so that they are external
		
		$('a[rel="external"]').click( function() {
	        window.open( $(this).attr('href') );
	        return false;
	    	});
		
		jQuery.each(jQuery.browser, function(i) {
  			if($.browser.msie){
 				
				$('#backbutton').mouseover(function(){
					$('#backbutton').css({'background':'transparent url(images/core/back-over.png) -1px 0px no-repeat','cursor':'pointer'});
				});

				$('#nextbutton').mouseover(function(){
					$('#nextbutton').css({'background': 'transparent url(images/core/next-over.png) 0px 0px no-repeat',  'cursor':'pointer'});
				});

				$('#homemain').mouseover(function(){
					$('#homemain').css({'background': 'transparent url(images/core/intro-over.png) top left no-repeat',  'cursor':'pointer'});
				});

				$('#productpanelcontainer').mouseover(function(){
					$('#productpanelcontainer').css({'background': 'transparent url(images/core/product-panel-home-bg.gif) top center no-repeat',  'cursor':'pointer'});
				});

				$('#backbutton').mouseout(function(){
					$('#backbutton').css({'background':'none','cursor':'pointer'});
				});

				$('#nextbutton').mouseout(function(){
					$('#nextbutton').css({'background': 'none',  'cursor':'pointer'});
				});

				$('#homemain').mouseout(function(){
					$('#homemain').css({'background': 'none',  'cursor':'pointer'});
				});

				$('#productpanelcontainer').mouseout(function(){
					$('#productpanelcontainer').css({'background': 'none',  'cursor':'pointer'});
				});
				$('.prodpanels').mouseover(function(){
					$(this).css({'background': 'transparent url(images/core/product-panel-bg.png) top left no-repeat',  'cursor':'pointer'});
				});
				$('.prodpanels').mouseout(function(){
					$(this).css({'background': 'transparent url(images/core/productbox.png) top left no-repeat',  'cursor':'pointer'});
				});

			}
		});

                // disable textselection on home page
		
		$('#productpanel').livequery('click', function(event){
			document.location.href = $('#prodlink').attr('href');
		});

		$('#homemain').livequery('click', function(event){
			document.location.href = 'index.php?page=our-story';
		});

		$('.prodpanels').livequery('click', function(event){
			document.location.href = $(this).attr('href');
		});

		$('#backbutton').livequery('click', function(event){
			$('.disableSelection').disableTextSelect();
			$('#productpanel').load("index.php?page=productpanels&current=-1", function(){
			});
		});

		$('#nextbutton').livequery('click', function(event){
			$('.disableSelection').disableTextSelect();
			$('#productpanel').load("index.php?page=productpanels&current=1", function(){
		        });
		});
	
});
