$(document).ready(function() {

	$('#technologo-image input.submit').click(function() {
        location.reload();
    });

	var $scrollingDiv = $("#scrollingDiv");
			
	$(window).scroll(function(){			
			$scrollingDiv
				.stop()
				.animate({"marginTop": ($(window).scrollTop() + 30) + "px"}, "slow" );			
	});

    $('#slider').nivoSlider();
	
		//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
	
	//$(function() {
	//	$( "#tabs" ).tabs();
	//});

	//jQuery('#body .first-and-second-carousel li').css('display','block');
	//jQuery('#mostpopular .first-and-second-carousel li').css('display','block');
	//jQuery('#foottest .first-and-second-carousel li').css('display','block');
	//jQuery('#mytestimonials .first-and-second-carousel li').css('display','block');
	//jQuery('#whyus li').css('display','block');
	//jQuery('#wpnews').css('display','block');
	jQuery('#primary .basket fieldset.delivery-address li.select input').css('display','none');
	jQuery('#primary .basket fieldset.billing-address li.select input').css('display','none');

    // Initialise the first and second carousel by class selector.
	// Note that they use both the same configuration options (none in this case).
	//jQuery('.first-and-second-carousel').jcarousel();
	
	// If you want to use a caoursel with different configuration options,
	// you have to initialise it seperately.
	// We do it by an id selector here.
    //jQuery('#third-carousel').jcarousel({ vertical: true });	

	//$("#whyus").easySlider({
	//	auto: false,
	//	continuous: true 
	//});

	//$('#wpnews').append($('#datepicker'));

	$('#top-search input#keywords').attr({
		value: "Search"
	});

	$('#top-search input#keywords').click(function() {  $(this).val("") });

//	$('div.filter').change(function() {
//  		($(this).val() == "restriction1-embroidered") ? $('select#restriction2.r-multiplier').show() : $('select#restriction2.r-multiplier').hide();
//	});

$(function() {  
$("select#restriction2.r-multiplier").show();

$("select#restriction1").change(function(){
    if ($(this).val() == "restriction1-embroidered")
        $('"select#restriction2.r-multiplier", label[for="restriction2"]').hide();
    else
        $('"select#restriction2.r-multiplier", label[for="restriction2"]').show();
    });
});

if ($('#product .basket fieldset label > span.desc:contains("Setup")').length > 0) {
        $("div#additional-costs div.filter").hide();
}

});

function openChatWindow(){
	var tracker=_gat._getTrackerByName();
	window.open(tracker._getLinkerUrl('http://livechat.boldchat.com/aid/6608957341269986646/bc.chat?cwdid=2034301991226328176&amp;url=' + escape(document.location.href)), 'Chat5155760989248014630', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=480');
	return false;
}
