var browserName=navigator.appName; 
var browserVer=parseInt(navigator.appVersion); 

	function FnListOn(ul) {
		if (browserName=="Microsoft Internet Explorer" && browserVer>=4) {
			document.getElementById(ul).style.marginLeft = "0";
		}
	}
	
	function FnListOff(ul) {
		if (browserName=="Microsoft Internet Explorer" && browserVer>=4) {
			document.getElementById(ul).style.marginLeft = "-1000em";
		}
	}

	/* script to change tabs on sponsor */
	function FnSponsorDescOn(on,off1,tabon,taboff1) {
		document.getElementById(on).className = "tab_content on";
		document.getElementById(off1).className = "tab_content off";
		document.getElementById(tabon).className = "tabon";
		document.getElementById(taboff1).className = "taboff";
	}

	/* script to change tabs on cdwow */
	function FnDescOn(on,off1,off2,tabon,taboff1,taboff2,colour) {
		document.getElementById(on).className = "tab_content " + colour + " on";
		document.getElementById(off1).className = "tab_content " + colour + " off";
		document.getElementById(off2).className = "tab_content " + colour + " off";
		document.getElementById(tabon).className = "tab_" + colour + "_t tabon";
		document.getElementById(taboff1).className = "tab_" + colour + "_t taboff_" + colour;
		document.getElementById(taboff2).className = "tab_" + colour + "_t taboff_" + colour;
	}
	
	/* script to change tabs on reward details pages */
	function FnRewardTabOn(on,off1,off2,tabon,taboff1,taboff2) {
		document.getElementById(on).className = "tab_content_on";
		document.getElementById(off1).className = "tab_content_off";
		document.getElementById(off2).className = "tab_content_off";
		document.getElementById(tabon).className = "tabon";
		document.getElementById(taboff1).className = "taboff";
		document.getElementById(taboff2).className = "taboff";
	}

	function fnRedeemGift(form) {
		if(form.giftIndicator.checked) {
			document.getElementById('redeem_giftad').style.display = "block";
		}
		
		if(!form.giftIndicator.checked) {
			document.getElementById('redeem_giftad').style.display = "none";
		}
		
		fnEnableGift(document.Redemption);    
		}

	/* cse search bar featured on collect on online page - cse form val */
	function fnValSearch(field){
		if (document.getElementById(field).value === '') {
			alert("Please enter a search term");
			return false;
		}
	}

	/* jquery scripts */
	jQuery(document).ready(function() {
    
		// jcarousel treats
		function jcarTreatsFunc() {
			$("#jcarouseltreats").removeClass("treatscar");
			jQuery('#jcarouseltreats').jcarousel({
	        visible: 2,
					scroll: 2,
					wrap: "both",
					animation: "slow"
	    });
		}
		if ($("#jcarouseltreats").length > 0 ) jcarTreatsFunc(); 
		
			//jecarousel toptips
		function jcarTipsFunc() {
			if ($.browser.safari) {
				//$("#jcarouseltips").removeClass("toptips");
				//jQuery('#jcarouseltips').jcarousel({
		    //    visible: 1,
				//		scroll: 1,
				//		start: 100,
				//		wrap: "both",
				//		auto: 10,
				//		animation: "slow"
		    //});
			} else {
				$("#jcarouseltips").removeClass("toptips");
				jQuery('#jcarouseltips').jcarousel({
		        visible: 1,
						scroll: 1,
						start: 0,
						wrap: "both",
						auto: 10,
						animation: "slow"
		    });
			}
		}
		if ($("#jcarouseltips").length > 0 ) jcarTipsFunc(); 
		
		//testimonials ajax test
		function testimonialsFunc() {
				$.ajax({
			    url: '/contents/html/load/testimonials.htm',
			    type: 'POST',
			    dataType: 'html',
					timeout: 5000,
			    error: function(){
			        alert('Error loading list');
			    },
			    success: function(html){
			      var intTest = 0;
						$(html).find("li").each(function(){
							intTest = intTest + 1;
						});
						var intTest = Math.floor(Math.random() * intTest);
						var strTest = [ $(html).find("li").eq(intTest).text() ]; 
						
						$(".testimonials_txt").replaceWith("<p>" + strTest + "</p>");
						
			    }
				});
		}
		if ($(".testimonials_txt").length > 0 ) testimonialsFunc();
		
});

 
		
	