
jQuery(document).ready(function() {

jQuery(".newsletter_colorbox").colorbox({
		
		width: 500,
		height: 320,
                iframe: true,
		transition: "none",
		onComplete: function() {
			
			
		}
	});
	

jQuery(".press_item_image_link").colorbox({
		innerWidth: "505px",
		innerHeight: "740px",
		scrolling: false,	
    transition: "none",    	
		onComplete: function() {
			jQuery('.articles').cycle({ 
					    fx:     'fade', 
					    speed:  'slow', 
					    timeout: 0,
					 	next: '.dots_articles, .articles',
					    pager:  '.dots_articles', 
								    pagerAnchorBuilder: function(idx, slide) {
							return '<a href="#">&middot;</a>';
						}
						});					                   						
						
			
		}
	});



	jQuery('.zoom').click(function() {
		if( !jQuery(this).hasClass('panzoom-ed') ) {
			return false;
		}
	});
	
	/*
	jQuery('.product_zoom').cycle({ 
	    fx:     'fade', 
	    speed:  'slow', 
	    timeout: 0, 
			before: function() {
				var index = jQuery('.product_cycle').index( jQuery(this) );
				var selector = '.zoom:eq(' + index + ')';				        
				
				bind_zoom_stuff( selector );
			}
	});
	*/
	
	
	
if( jQuery('.product_zoom').length == 1 ) {
		bind_zoom_stuff( '.product_zoom .zoom' );
	}


//document.getElementById('main_product_image').style.visibility='visible';

YAHOO.util.Event.onAvailable("extra_image_zoom_href_0", function () {
  YAHOO.util.Event.onAvailable("main_product_image", function () {
    document.getElementById('main_product_image').style.visibility='visible';
  });
});
	
					
});


function bind_zoom_stuff( selector ) {
     
		if( !jQuery(selector).hasClass('panzoom-ed') ) {
			jQuery.panzoom( selector );
			// console.log( selector, jQuery(selector) );
			jQuery(selector).addClass('panzoom-ed');
		}
	}
