function jsFunctions(){
// ------------------- SOTD Page ---------------------------//
//Big Steal Thumbnails
		$("#big_steal_thumbnail li").each(
		function(i){
			$(this).children("a").mouseover(
				function(){
				var imgSrc = $(this).children("img").attr("src");
				var imgUrl = $(this).attr("href");
				$("#big_steal_img>a>img").attr("src", imgSrc);
				$("#big_steal_img>a").attr("href", imgUrl);
				}
			);
		}
	);
		
    //Hide Show Big Steal Description
	var hiddenSKU  =   $("input#hiddenSKU").attr("value");
	var skuURL = "showStealoftheday_prdDesc.asp";
	//alert($("#promotion_description").text().length);
	if ($.trim($("#promotion_description").text()).length <= 10)
	{
		
		$("table#big_steal_description_more_content td").load(skuURL, { sku: hiddenSKU  });		 
		$("input.big_steal_description_more_btn").attr("value", "Hide Information -");
			  
		}
	$(".big_steal_description_more_btn").toggle(
		function(){
			  $("table#big_steal_description_more_content td").load(skuURL, { sku: hiddenSKU  });		 
			  $("input.big_steal_description_more_btn").attr("value", "Hide Information -");
			 // alert("test");
		}
		 ,
		function(){
			   $("table#big_steal_description_more_content td").load(skuURL);
			  $("input.big_steal_description_more_btn").attr("value", "Show More Information +");
			   
		 
		} 
	);


//----------------------- Shopping cart -----------------------//
// alert box
   $("img#alert-box-on").click(
	   function(){
		   $("div#shadowbox-alert").css("display", "block");
	   }
	);
   $("input#alert-cancel").click(
	   function(){
		   $("div#shadowbox-alert").css("display", "none");
	   }
	);
	
	
// ------------------- Checkout System ---------------------------//
// show / hide registration block
   $("#checkout_register_swicth_on").click(
	   function(){
		   $("div.checkout_login_new_wrapper").slideDown("normal");
	   }
   );
   $("#checkout_register_swicth_off").click(
	   function(){
		   $("div.checkout_login_new_wrapper").slideUp("normal");
	   }
   );
	
// show / hide credit card CSC CVV code example block
   $("#checkout_creditcard_sample_show").hoverIntent(
	   function(){
		   $("div#checkout_creditcard_sample").fadeIn("fast");
	   },
	   function(){
		   //$("div#checkout_creditcard_sample").fadeIn("fast");
	   }
   );
   $("#checkout_creditcard_sample_hide").click(
	   function(){
		   $("div#checkout_creditcard_sample").fadeOut("fast");
	   }
   );


// ------------------- Account System ---------------------------//

// show / hide registration block
   $("#account_login_register_on").click(
	   function(){
		   $("div.account_login_register").slideDown("normal");
	   }
   );
   $("#account_login_register_off").click(
	   function(){
		   $("div.account_login_register").slideUp("normal");
	   }
   );
   
   $("div.result-close img").click(
	   function(){
		   $("div#shadowbox-track").css("display", "none");
	   }
								   
   );
   
// show / hide password block
    $("#pw-box-close").click(
		function(){
		   $("#pw-box").fadeOut("normal");
	   }
   );
   
// go to anchor (animated)
	$(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();

		var full_url = this.href;

		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];

		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;

		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, "normal");
    });

// show / hide reward overview content block
   $(".account_overview_switch").toggle(
	 function(){$(this).parents("table").next("div.account_reward_overview_block").slideUp("normal"); $(this).text("+ Show");},
	 function(){$(this).parents("table").next("div.account_reward_overview_block").slideDown("normal"); $(this).text("- Hide");}
	);   
   
 
// show / hide contact list retrieve block
   $("img#reward_add_hotmail").click(
	  function(){
		  $("div.reward_add_datainput_active").hide().removeClass("reward_add_datainput_active");
		  $("div.reward_add_datainput_indicator").css("margin-left","110px");
		  $("div#reward_add_hotmail_datainput").show().addClass("reward_add_datainput_active");
	  }
	);
   
   $("img#reward_add_gmail").click(
	  function(){
		  $("div.reward_add_datainput_active").hide().removeClass("reward_add_datainput_active");
		  $("div.reward_add_datainput_indicator").css("margin-left","310px");
		  $("div#reward_add_gmail_datainput").show().addClass("reward_add_datainput_active");
	  }
	);

   $("img#reward_add_yahoo").click(
	  function(){
		  $("div.reward_add_datainput_active").hide().removeClass("reward_add_datainput_active");
		  $("div.reward_add_datainput_indicator").css("margin-left","580px");
		  $("div#reward_add_yahoo_datainput").show().addClass("reward_add_datainput_active");
	  }
	);

   $("img.reward_add_datainput_block_close").click(
	  function(){
		  $("div.reward_add_datainput_active").hide().removeClass("reward_add_datainput_active");
	  }
	);
   
   
   // show / hide order related messages block
   $(".msg_hide").toggle(
	 function(){$(this).parents("table").next("table").slideUp("normal"); $(this).text("+ Show");},
	 function(){$(this).parents("table").next("table").slideDown("normal"); $(this).text("- Hide");}
	); 
   
   // show / hide return claim terms & conditions
   $(".return_tc_switch").parents("table").next("div").css("display","none");
   $(".return_tc_switch").toggle(
	 function(){$(this).parents("table").next("div").slideDown("normal");},
	 function(){$(this).parents("table").next("div").slideUp("normal");}
	);
   
   //show / hide help tips
   $("#msg_help_tips").css("display","none");
   $("#msg_type").change(
	 function(){$("#msg_help_tips").fadeIn("normal");}
	);
   
   $("ul.message_help li a").click(
	 function(){
		 $("ul.message_help li a.active").removeClass("active");
		 $("ul.message_help li div").slideUp();
		 $(this).next().slideDown("normal");
		 $(this).addClass("active");
	}
	);
   $(".msg_help_close").click(
	 function(){$(this).parent("p").parent("div").slideUp("normal");}						  
	);

   
// ------------------- Help Centre ---------------------------//
// show / hide answer content block
   $(".help_content_detail_switch").toggle(
	 function(){$(this).parents("table").next("div.help_content_detail_a").slideUp("normal"); $(this).text("+ SHOW");},
	 function(){$(this).parents("table").next("div.help_content_detail_a").slideDown("normal"); $(this).text("- HIDE");}
	);

//----------------------- testimonial scrolling -----------------------//
		
		 function animator(currentItem) {
		    
		  //work out new anim duration
		  var distance = currentItem.height();
			duration = (distance + parseInt(currentItem.css("marginTop"))) / 0.008;
			//0.025;

		  //animate the first child of the ticker
		  currentItem.animate({ marginTop: -distance }, duration, "linear", function() {
		    
			//move current item to the bottom
			currentItem.appendTo(currentItem.parent()).css("marginTop", 0);

			//recurse
			animator(currentItem.parent().children(":first"));
		  }); 
		};
		
		function testimonial_rolling(element_id)
		{
			
				var ticker = $(element_id);
				  
				//wrap dt:dd pairs in divs
				ticker.children().filter("dt").each(function() {
				  
				  var dt = $(this),
					container = $("<div>");
				  
				  dt.next("dd").appendTo(container);
				  dt.prependTo(container);
				  
				  container.appendTo(ticker);
				});
						
				//hide the scrollbar
				ticker.css("overflow", "hidden");
				
				//animator function
		
				//start the ticker
				animator(ticker.children(":first"));
						
				//set mouseenter
				ticker.mouseenter(function() {
				  
				  //stop current animation
				  ticker.children().stop();
				  
				});
				
				//set mouseleave
				ticker.mouseleave(function() {
						  
				  //resume animation
				  animator(ticker.children(":first"));
				  
				});
			
			
			}
			
		//call footer testimonial		 
		if ($("dl#top-testimonial").length > 0){
			testimonial_rolling("dl#top-testimonial");
		}
		
		//call top-testimonial
	 	if ($("dl#testimonial-row").length > 0){
			testimonial_rolling("dl#testimonial-row");
		}
		
		//call side-testimonial
		if ($("dl#side-testimonial-rolling").length > 0){
			testimonial_rolling("dl#side-testimonial-rolling");
		}

}


