var zoomed = false;

$(document).ready(function() {
		
	// --------------------------------------------------------------------- //
	// blur any links after click (to remove selection borders)

		$('a').click(function() {
			this.blur();
			return true;
		});
	
	    
    // --------------------------------------------------------------------- //
	// menu and button effects
        	    	
    	$('ul.nav').hover(function() {
    			$('.iconmenu').attr('src','/wp-content/themes/gyf/images/btn_menu_over.gif');
    		}, function() {
    			$('.iconmenu').attr('src','/wp-content/themes/gyf/images/btn_menu_off.gif');
    	});
    	    	    	
    	$('.iconlistthumbs').hover(function() {
    			$(this).attr('src','/wp-content/themes/gyf/images/btn_listthumbs_over.gif');
    		}, function() {
    			$(this).attr('src','/wp-content/themes/gyf/images/btn_listthumbs_off.gif');
    	});
    	
    	$('.iconzoom').hover(function() {
    			$(this).attr('src','/wp-content/themes/gyf/images/btn_zoom_over.gif');
    		}, function() {
    			$(this).attr('src','/wp-content/themes/gyf/images/btn_zoom_off.gif');    			
    	});
    	
    	$('.iconinfo').hover(function() {
    			if(($.cookie('gy_showcutlines')) == 'yes') {
    				// do nothing
    			} else {
    				$(this).attr('src','/wp-content/themes/gyf/images/btn_info_over.gif');
    			}
    		}, function() {
    			if(($.cookie('gy_showcutlines')) == 'yes') {
    				$(this).attr('src','/wp-content/themes/gyf/images/btn_info_on.gif');
    			} else {
    				$(this).attr('src','/wp-content/themes/gyf/images/btn_info_off.gif');
    			}
    	});
    	
    	$('.gysearchfield').focus(function() {
    		
    	});
                			
	
	// --------------------------------------------------------------------- //
	// toggle cutlines button on/off			
	
		$('.toggle_cutlines').click(function() {
				$('#sub_page_sidebar_cutlines').toggle();
				if(($('#sub_page_sidebar_cutlines').css('display') == 'none')) {
					$('.iconinfo').attr('src','/wp-content/themes/gyf/images/btn_info_off.gif');					
					$.cookie('gy_showcutlines', 'no', {expires: null, path: '/'});
				} else {
					$('.iconinfo').attr('src','/wp-content/themes/gyf/images/btn_info_on.gif');					
					$.cookie('gy_showcutlines', 'yes', {expires: null, path: '/'});
				}
		});
										
		if(($.cookie('gy_showcutlines')) == 'yes') {
			$('.iconinfo').attr('src','/wp-content/themes/gyf/images/btn_info_on.gif');
			$('#sub_page_sidebar_cutlines').show();
		} else if(($.cookie('gy_showcutlines')) == 'no') {
			$('.iconinfo').attr('src','/wp-content/themes/gyf/images/btn_info_off.gif');
			$('#sub_page_sidebar_cutlines').hide();
		}
				
		$("ul.nav").superfish();
});