<!--//--><![CDATA[//><!--
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
    if(sfEls != null){
        sfEls = sfEls;
    }else{
        sfEls = "";
    }
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>

function shareLinks(){
var shareBox = $("ul.shareLinks li .shareBox");
var followUs = $("ul.shareLinks li.followUs");
  
    $(followUs).hover(function(){
			$(followUs).addClass("active");
			$(shareBox).show();						   
		}, function(){
			$(followUs).removeClass("active");
			$(shareBox).hide();			
		});
}


function quickLinks(){
var quickLinks = $("ul.loginLinks a.quickLinks");	
var quickLinksBlock = $(".quickLinksBlock");
var quickLinkscloseBtn = $(".quickLinksInner a.closeBtn");
	//$(quickLinksBlock).hide();
	$(quickLinks).click(function(){
							   
							  $(quickLinksBlock).css({"visibility":"visible"});
							  $(".header ul.loginLinks li.quicklink a").addClass("selected");
							  
							  
							  });
	
	$(quickLinkscloseBtn).click(function(){
							   
							  $(quickLinksBlock).css({"visibility":"hidden"});
							   $(".header ul.loginLinks li.quicklink a").removeClass("selected");
							  
							  
							  });
	}

$(document).ready(function(){
  shareLinks();
  quickLinks();

  $("#nav li:first a").addClass("first");// Add class to extra paddiing
  $("#nav li:last-child").children().next().addClass("lastMenu");
  //$(".chkoutTableTitle:last , .chkoutTableColumn:last").css({"background":"none"});
 // $("#nav li ul").addClass("subMenu");// Add class to extra paddiing
  
  /* Selected Menu Item */
	$("#nav li").each(function(i){
			var _count = $("#nav li a").filter(".selected").index("#nav li a");
			$(this).hover(function(){
				$(this).children().addClass("selected");
			},function(){
				$(this).children().removeClass("selected");	
				$("#nav li a").eq(_count).addClass("selected");
			});	
	});
	/* end Selected menu Item */

    /* Even and Odd Table row background-color:#f4f4f4 */
    $(".richEditor table tr:odd").css({"background-color":"#f4f4f4"});    
    /* End here */
  
  $("#clientLogo").innerfade({ speed: 'slow', timeout: 4000, type: 'sequence', containerheight: '79px' }); 
  //$('.whatwedoMain').fixHeight();
  
  // Initialise the first and second carousel by class selector.
	// Note that they use both the same configuration options (none in this case).
	jQuery('.awardsright .first-and-second-carousel , .overview_left .first-and-second-carousel , .overview_rightside .first-and-second-carousel , .whyrichardson .first-and-second-carousel').jcarousel();
	
	$("#carousel").featureCarousel({
          // include options like this:
          // (use quotes only for string values, and no trailing comma after last option)
          // option: value,
          // option: value
        });
	
	jQuery(function($) {
	$("img.reflect").reflect({/* Put custom options here */});	
	});
	
	$(".shopCart").hover(function(){
		$(".cartBox",this).css({"visibility":"visible"});							  
	},function(){
		$(".cartBox",this).css({"visibility":"hidden"});							  
	});
	
    /* Accordion */
	$(".firstAcc .menuitem").each(function(i){
		$(".firstAcc .menuitem").next().eq(0).show();
		$(".firstAcc .menuitem").eq(0).children().addClass("menuselected");
        $('#scrollbar1').tinyscrollbar();
		$(this).click(function(){
			$(".firstAcc .menuitem").next().slideUp("slow");
			$(".firstAcc .menuitem").children().removeClass("menuselected");
			$(this).next().slideDown("slow");
			$(this).children().addClass("menuselected");
            $('#scrollbar1, #scrollbar2').tinyscrollbar();
			return false;
		});					
	});
	$(".secondAcc .menuitem").each(function(i){	
		$(".secondAcc .menuitem").next().eq(0).show();
		$(".secondAcc .menuitem").eq(0).children().addClass("menuselected");
        $('#scrollbar3').tinyscrollbar();
		$(this).click(function(){
			$(".secondAcc .menuitem").next().slideUp("slow");
			$(".secondAcc .menuitem").children().removeClass("menuselected");
			$(this).next().slideDown("slow");
			$(this).children().addClass("menuselected");
            $('#scrollbar3, #scrollbar4, #scrollbar5, #scrollbar6, #scrollbar7').tinyscrollbar();
			return false;
		});					
	});
	$(".thirdAcc .menuitem").each(function(i){	
		$(".thirdAcc .menuitem").next().eq(0).show();
		$(".thirdAcc .menuitem").eq(0).children().addClass("menuselected");
		$(this).click(function(){
			$(".thirdAcc .menuitem").next().slideUp("slow");
			$(".thirdAcc .menuitem").children().removeClass("menuselected");
			$(this).next().slideDown("slow");
			$(this).children().addClass("menuselected");
			return false;
		});					
	});
	$(".globalreach_accordian .menuitem").each(function(i){	
		$(".globalreach_accordian .menuitem").next().eq(0).show();
		$(".globalreach_accordian .menuitem").eq(0).children().addClass("menuselected");
		$(this).click(function(){
			$(".globalreach_accordian .menuitem").next().slideUp("slow");
			$(".globalreach_accordian .menuitem").children().removeClass("menuselected");
			$(this).next().slideDown("slow");
			$(this).children().addClass("menuselected");
			return false;
		});					
	});
	
    /* Home page tab 3 scrollbar */
   $("#richardson_tabsystem1 li a[rel=featured]").click(function(){
     $('#tabScroll').tinyscrollbar();   
   });
     /* End Home page tab 3 scrollbar */

    //var script1 = '';
	$('.liveChat').click(function () {
		$.ajax({
			url: 'ChatScriptHandler1.info',
			success: ShowChatWindow,
			error: AjaxError
		});
		return false;
	});

	/* End Accordion */	 

   	//EOF: subscriber/InsertWidget.js
		function ShowChatWindow(result) {
			var recipe = window.open('', 'RecipeWindow', 'width=310px,height=350px,status=1,location=no,titlebar=no');
			//var rs1 = '<script type="text/javascript" src="http://cdn.widgetserver.com/syndication/subscriber/InsertWidget.js"></script><script type="text/javascript">if (WIDGETBOX) WIDGETBOX.renderWidget(''f5f8c526-062d-4a01-bafc-5a17a8044a4f'');</script><noscript>Get the <a href="http://www.widgetbox.com/widget/meebo-me">meebo me!</a> widget and many other <a href="http://www.widgetbox.com/">great free widgets</a> at <a href="http://www.widgetbox.com">Widgetbox</a>! Not seeing a widget? (<a href="http://docs.widgetbox.com/using-widgets/installing-widgets/why-cant-i-see-my-widget/">More info</a>)</noscript>'
			var html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en">' + '<head> <title>Richardson</title></head><body>' + result + '<p style="font:12px Tahoma, Arial, Helvetica, sans-serif; color:#666;"> Not seeing widget? Download flash <a href="http://www.adobe.com/go/getflashplayer" target="_blank"> here.</a> </p></body></html>';  //result
			//var html =  result ;
			recipe.document.open();
			recipe.document.write(html);
			recipe.document.close();
			return false;
		};

		function AjaxError(result) {
			alert("Error");
		};


    /* Alert box for IE6 and FireFox 2 */
		var _flag = browserDetect();
		if(_flag){						 
			$(".fbCommentBox").hide();
		}	
	/* And Alert box for IE6 and FireFox 2 */
    
    /* form Reset Code */
    $(".btn_reset").click(function(){
         //$(".formfield select").attr('selectedIndex', 0);
        $('select option:nth-child(1)').attr('selected', 'selected')
        $(".formfield input:text").val("");	
        $(".formfield input:password").val("");	
	    $(".formfield textarea").val("");
		$(".formfield input:checkbox").attr("checked", false);
	    $(".formfield .formerror").hide();
	    return false;
    });
    /* End Form Reset Code */ 
    
    

});

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

	

