jQuery(document).ready(function($) {
	
	// if user is signed in, show YouAreSignedIn menu, if user is signed out, show NotSignedIn menu
		if (
			$('#AreYouGuest').html() == '') {
				  $("#YouAreSignedIn").css('display','none');
    			  $("#YouAreSignedIn").remove();
				  $("#NotSignedIn").show();
				}
				else {
				  $("#NotSignedIn").css('display','none');
				  $("#NotSignedIn").remove();
				  $("#YouAreSignedIn").show();
				}
	// end
	
		$('body.RequestCatalog #ContactForm .message').html('Address');
	
		$('#provider_list .ProviderNamecheckout_authorizenet').after('<span><img src="/templates/__custom/images/generic.png" alt="" width="22" height="22" /></span>');
		$('#provider_list .ProviderNamecheckout_paypal').after('<span><img src="/templates/__custom/images/paypal.png" alt="" width="22" height="22" /></span>');
	
	// remove items from layout // unused and undesired divs and panels in current theme
		$('#SideShopByBrand, .Left #SideNewsletterBox, .Left #SideNewProducts').remove();
	// end
	
	// replace text inside input fields
		function textReplacement(input){
		var originalvalue = input.val();
		input.focus( function(){
			if( $.trim(input.val()) == originalvalue ){ input.val(''); }
		});
		input.blur( function(){
			if( $.trim(input.val()) == '' ){ input.val(originalvalue); }
		});
		}

		textReplacement($('#search_query')); // search
		textReplacement($('#nl_first_name')); // newsletter name
		textReplacement($('#nl_email')); // newsletter email
		textReplacement($('#revtitle')); // review title
		textReplacement($('#revfromname')); // review name
		textReplacement($('#captcha')); // captcha
	// end
	
	// add First class to first list item on menus
		$('#Menu li:first-child, #Footer li:first-child').addClass('First');
	// end
	
	// add Last class to last list item on menus
		$('#Menu li:last-child, #Footer li:last-child').addClass('Last');
	// end
	
	// remove last list item to change a 5 product list to 4
	/*
		$('#INSERTPANELHERE .ProductList li:nth-child(5)').hide('');
	*/
	// end
	
// CUSTOM AND OPTIONAL SCRIPTS // Enable only if needed
	
	// homepage slideshow // image/content cycler
		$('#HomeSlideshow .slideshow').cycle({
			timeout:5000,
			fx:'fade', 
		// pager for slideshow navigation // Remove if not needed 
    		pager:  '#HomeSlidePager .pager',
   			next:   '#HomeSlideshow .next', 
    		prev:   '#HomeSlideshow .prev'
		});
	// end
	
});

