/***************
DEFAULT PRODUCTS ARE SPECIFIED HERE
****************/

/*********
default wristbands
*********/
var tyvek_selected='tyvek1';
var festival_selected='festival1';
var tabbed_selected='tabbed1';
var silicon_selected='silicon1';
var reusable_selected='reusable1';


/*********
default lanyards
*********/
var stock_selected='stock1';
var print_selected='print1';
var screen_selected='screen1';
var screenpt_selected='screenpt1';
var cotton_selected='cotton1';
var fullcolour_selected='fullcolour1';

/***************
FUNCTIONS FOR HANDLING PRODUCT OPTION BUTTONS
***************/
function displayProduct(productFamily, productID) {
	//check what the current family item is...
	currentProductID=eval(productFamily+'_selected');
	hideProduct(currentProductID);
	showProduct(productID);
	eval(productFamily+"_selected=productID");
}

function hideProduct(productID) {
	$("#"+productID+"_image").hide();
	$("#"+productID+"_colours").hide();
}

function showProduct(productID) {
	$("#"+productID+"_image").show();
	$("#"+productID+"_colours").show();
}

/***************
FUNCTION FOR HOW TO ORDER POPUP
***************/

$(document).ready(function() { 

 	$("a.howToOrderPopUp").fancybox({ 
	 	'hideOnContentClick': false,
	 	'padding': 30,
 		'overlayOpacity': 0.7,
 		'frameWidth': 740, 
 		'frameHeight': 440 
 	}); 
 	
 	$("a.howToOrderPopUpLanyard").fancybox({ 
	 	'hideOnContentClick': false,
	 	'padding': 30,
 		'overlayOpacity': 0.7,
 		'frameWidth': 740, 
 		'frameHeight': 520,
 		'centerOnScroll': false
 	}); 	
 	$("a.howToOrderPopUpAccessories").fancybox({ 
	 	'hideOnContentClick': false,
	 	'padding': 30,
 		'overlayOpacity': 0.7,
 		'frameWidth': 740, 
 		'frameHeight': 300 
 	}); 	
 	
 	$("a.palettePopUp").fancybox({ 
	 	'hideOnContentClick': false,
	 	'padding': 30,
 		'overlayOpacity': 0.7,
 		'frameWidth': 680, 
 		'frameHeight': 490 
 	});  	
 	$("a.deliveryPopUp").fancybox({ 
	 	'hideOnContentClick': false,
	 	'padding': 30,
 		'overlayOpacity': 0.7,
 		'frameWidth': 740, 
 		'frameHeight': 530 
 	});  	 	
 }); 


function gotoEnquiryForm() {
	//close the popup window
	
	//redirect to the contact page
	document.location='contact.php';
	
}


function howToOrder() {
	//displays popup window with ordering details...
	
}

function slideSwitch() {
    var $active = $('#specialOfferImage img.active');

    if ( $active.length == 0 ) $active = $('#specialOfferImage img:last');

    var $next =  $active.next().length ? $active.next()
        : $('#specialOfferImage img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("slideSwitch()", 3000 );
});
