/* $Rev: 3782 $ */

// onclick of thumb, update main image to use thumb and swap page details
var thumbs = jQuery('#press_view_list div.press_item a');
jQuery('#press_view_list div.press_item').hoverClass('highlight');

var jqimg = jQuery('#press_view_main div.jqzoom');
var feature = jQuery('#press_view_main div.jqzoom img');
var details_display = jQuery('div#current_page_details');

var swap_map = {
	"src": "href"
,	"longdesc" : "rev"
}

feature.beautySwap(thumbs, swap_map);

if (jqimg.length > 0)
{
	zoom_options = {
		xzoom: 416
	,	yzoom: 400
	,	offset: 12
	,	top_offset: -1
	,	preload: 1
	,	lens: 1
	,	track: false
	}
	
	jQuery(function(){
		jqimg.jqueryzoom(zoom_options);
	});
}

/* only applicable when products are involved
// on page load, check for page in url hash
var id = document.location.hash;
	
if (id.indexOf('#') != -1)
{
	// update main image with this one
	// complete id not passed in url, prevents page jump
	var page = jQuery(id + '-container a');
}
else var page = jQuery('div.press_item:first a');

page.click();

function highlight_selected_press(thumb)
{
	var class_name = thumb.parent().attr('id').replace('-container', '-product_thumb');
	
	var current_products = jQuery('#all_products li.' + class_name);
	var products = jQuery('#all_products li:not(:empty)').not(current_products);
	
	thumbs.removeClass('highlight');
	thumb.addClass('highlight');
	
	var current_h3 = jQuery('#all_products h3.selected_page_products');
	var current_ul = jQuery('#all_products ul.selected_page_products');
	
	var all_h3 = jQuery('#all_products h3.all_products');
	var all_ul = jQuery('#all_products ul.all_products');
	
	if (current_products.length > 0)
	{
		current_ul.empty().append(current_products).show();
		current_h3.show();
		all_h3.text('Other Products in this Article');
	}
	else
	{
		current_ul.empty().hide();
		current_h3.hide();
		all_h3.text('Featured Products');
	}
	
	if (products.length > 0)
	{
		all_ul.empty().append(products).show();
		all_h3.show();
	}
	else
	{
		all_ul.empty().hide();
		all_h3.hide();
	}
};
*/
