//js
var printerImages = 'images/products/printerstrip/';

$(document).ready( function() {
	//hide all printer details except default printer
	$("DIV.printer").hide();
	$("DIV.bx600fw").show();
	
	if($("UL.printerSelection").length != 0){
		//show the printerlist
		$("UL.printerSelection").show();				
		$("UL.printerSelection LI").addClass('pclosed');
		$("UL.printerSelection LI.default").addClass('dopen');
		
		$("UL.printerSelection LI A")
		.click(function(){
			var printertoshow = $(this).attr("class");
			$("DIV.printer").hide();
			$("DIV." + printertoshow).show();
			if(printertoshow == 'bx600fw' || printertoshow == 'b40w'){
				$('DIV.additional P.printerSpecial').show();
			}else{
				$('DIV.additional P.printerSpecial').hide();
			}
			return false;			
		});
		$("UL.printerSelection LI A IMG").mouseover(function(){
			var printerIndex = $(this).parent().attr("class");
			$("UL.printerSelection LI.default").addClass('dclosed');
			if($("UL.printerSelection LI.popen").length != 0){
				var imagesNode = $("UL.printerSelection LI.popen IMG:eq(0)")
				var image = $(imagesNode).parent().attr("class");
				imagesNode.attr({src:printerImages + image + '.gif'});

				$("UL.printerSelection LI.popen").addClass('pclosed').removeClass('popen');
			}
			$("UL.printerSelection LI." + printerIndex).removeClass('pclosed').addClass('popen');
			$(this).attr({src:printerImages + printerIndex + '_on.gif'});
		});
	}
	
	//css tidy up (for non-js version)
	$(".printer").css("border","none")
	$("#footerContainer").css("top","1308px")
	
	// open links in a new window
	$("A.exLink").click(function(e){
		var destination = $(this).attr('href');
		$(this).attr({target:'_blank'});
		/*
		window.open(destination);
		e.preventDefault();
		*/
	});

	//SWFobject flash media : documentation ref - http://code.google.com/p/swfobject/wiki/documentation
	var flashvars = {};
	var attributes = {};
	var params = {
	scale: "noscale",
	somename:  "",
	salign: "LT",
	menu: false,
	wmode: "transparent",
	allowScriptAccess: "always"
	};
	swfobject.embedSWF("flash/BIJ_ST_446x80_DE.swf", "topcentercontent", "446", "80", "8","expressInstall.swf", flashvars, params, attributes);

	swfobject.embedSWF("flash/BIJ_360x260_landing_DE.swf", "flash_bx600fw", "360", "260", "8","expressInstall.swf", flashvars, params, attributes);

/* printer flash placeholder ids
width:360px, height:260px
flash_bx600fw
flash_b40w
flash_bx300f
flash_d120
flash_b300
*/
});

