$(document).ready(function(){

var sitefunctions = {
	textresize : function(){
		// show text resizing links
		$(".FontSize").show();
                var $homeurl = window.location.hostname;
		  var $cookie_name = "FastEditFontSize";
		  var originalFontSize = $(".content").css("font-size");
		// if exists load saved value, otherwise store it
		  if($.cookie($cookie_name)) {
			var $getSize = $.cookie($cookie_name);
			$(".content").css({fontSize : $getSize + ($getSize.indexOf("px")!=-1 ? "" : "px")}); // IE fix for double "pxpx" error
		} else {
			$.cookie($cookie_name, originalFontSize);
		}
		// reset link
		$(".FontSizeReset").bind("click", function() {
			$(".content").css("font-size", originalFontSize);
			$.cookie($cookie_name, originalFontSize);
		});
		// text "+" link
		$(".FontSizeInc").bind("click", function() {
		  var currentFontSize = $(".content").css("font-size");
		  var currentFontSizeNum = parseFloat(currentFontSize, 10);
		  var newFontSize = currentFontSizeNum*1.2;
		  if (newFontSize, 11) {
		    	$(".content").css("font-size", newFontSize);
		    	$.cookie($cookie_name, newFontSize);
		  }
		  return false;
		});
		// text "-" link
		$(".FontSizeDec").bind("click", function() {
		  var currentFontSize = $(".content").css("font-size");
		  var currentFontSizeNum = parseFloat(currentFontSize, 10);
		  var newFontSize = currentFontSizeNum*0.8;
		  if (newFontSize, 11) {
		   	$(".content").css("font-size", newFontSize);
		    	$.cookie($cookie_name, newFontSize);
		  }
		  return false;
		});
	}
}
sitefunctions.textresize();


// IE6 png fix
$('.transparent').supersleight({shim: 'http://fast-edit.co.uk/template/images/blank.gif'});


// vertical news ticker - Tadas Juozapaitis ( kasp3rito@gmail.com ) - http://plugins.jquery.com/project/vTicker
(function(a){a.fn.vTicker=function(b){var c={speed:700,pause:4000,showItems:3,animation:"",mousePause:true,isPaused:false,direction:"up",height:0};var b=a.extend(c,b);moveUp=function(g,d,e){if(e.isPaused){return}var f=g.children("ul");var h=f.children("li:first").clone(true);if(e.height>0){d=f.children("li:first").height()}f.animate({top:"-="+d+"px"},e.speed,function(){a(this).children("li:first").remove();a(this).css("top","0px")});if(e.animation=="fade"){f.children("li:first").fadeOut(e.speed);if(e.height==0){f.children("li:eq("+e.showItems+")").hide().fadeIn(e.speed)}}h.appendTo(f)};moveDown=function(g,d,e){if(e.isPaused){return}var f=g.children("ul");var h=f.children("li:last").clone(true);if(e.height>0){d=f.children("li:first").height()}f.css("top","-"+d+"px").prepend(h);f.animate({top:0},e.speed,function(){a(this).children("li:last").remove()});if(e.animation=="fade"){if(e.height==0){f.children("li:eq("+e.showItems+")").fadeOut(e.speed)}f.children("li:first").hide().fadeIn(e.speed)}};return this.each(function(){var f=a(this);var e=0;f.css({overflow:"hidden",position:"relative"}).children("ul").css({position:"absolute",margin:0,padding:0}).children("li").css({margin:0,padding:0});if(b.height==0){f.children("ul").children("li").each(function(){if(a(this).height()>e){e=a(this).height()}});f.children("ul").children("li").each(function(){a(this).height(e)});f.height(e*b.showItems)}else{f.height(b.height)}var d=setInterval(function(){if(b.direction=="up"){moveUp(f,e,b)}else{moveDown(f,e,b)}},b.pause);if(b.mousePause){f.bind("mouseenter",function(){b.isPaused=true}).bind("mouseleave",function(){b.isPaused=false})}})}})(jQuery);
// Feedback box settings
$('#feedback').vTicker({ 
		speed: 500,
		pause: 3000,
		animation: 'fade',
		mousePause: true,
		showItems: 3,
		height: 120,
   		direction: 'up'
		});


// FAQ hide/unhide effects
$("a[name^='faq-']").each(function() { $(this).click(function() {
			if( $("#" + this.name).is(':hidden') ) { $("#" + this.name).slideDown('normal');} 
                        else { $("#" + this.name).slideUp('normal');}			
			return false;});});

$('.faq-login').click(function () {
 			$('#faq-0301').slideDown(500);
			$.cookie('#faq-0301', 'open');});

$('.close-faq-login').click(function () {
			$.cookie('#faq-0301', 'null');
			return false;});

		var faqlogin = $.cookie('#faq-0301');
    			if (faqlogin == 'open') {
			$('#faq-0301').slideDown(500);};


// Alternate row color of tables with class="striped"
$(function(){  $("table.striped tr:even").addClass("oddrow");});



});

	


