$("document").ready(function(){
/* clear and restore search fields */
$('#search input#search_term').val('Search');
 $('input#newsletter_submit').wrap('<p id="nls_wrap"></p>');
 $('#search_term').removeClass('clearClick').addClass('clickClear');
 $('#newsletter_text').removeClass('clearClick').addClass('clickClear');
 $('input.clickClear').focus(function() {
    startText = $(this).val();
    $(this).val('').addClass('focus');
 });
 $('input.clickClear').blur(function() {
    blurText = $(this).val();
    if (blurText == '') {
       $(this).val(startText).removeClass('focus');
    };
 }); 


$("#footer #quicklinks a:last, #utillinks a:last, #nav li:last").addClass("last");
$("#breadcrumbs a:first,#quicklinks a:first, #utility a:first").addClass("first");  
  
if($("#breadcrumbs").text() < 1){
	$("#breadcrumbs").hide();
	} 
	
// color box launch
$('#login .thickbox, #comments .thickbox').colorbox({iframe:true,width:400, height:250});
$('#footer .thickbox').colorbox();
$('#content .slideshow').colorbox({
		slideshow:true,
		photo:true,
		preloading:true,
		slideshowSpeed:5000
		});
$('.rsvp .thickbox, #text .thickbox').colorbox({iframe:true,width:450, height:570});
$('#options .thickbox,.section .thickbox').colorbox({iframe:true,width:500, height:570});  
//@end  


$("#sub.cart .monkCart tr.total td:eq(0)").html("");
$("#sub.checkout .monkCart tr.total:eq(0)").remove();	   
$("#sub.checkout .monkCart tr.total:eq(1) td:eq(0)").html(""); 	
});/*@end*/     

 var t;
   $("document").bind('cbox_complete',function(){
	  t = setTimeout(hideAnchor(),300);  
	});
  function hideAnchor(){
	$("iframe").contents().find("a").hide(function(){
		clearTimeout(t);
	});
}