/*
Cufon.replace('h1.cufon');
Cufon.replace('h2.cufon');
Cufon.replace('h3.cufon');
Cufon.replace('h4.cufon');
 */
$(".option").css("display", "none");

$(document).ready(function() {

	if( $('#breadcrumbs').length > 0 ) {
		
		html = $('#breadcrumbs').html();
		if( html.indexOf("<br") > 0 ){
		
			var open_class = 'opened';
			var close_class = 'closed';
			
			$('<p><span>[Expand]</span> Categories which this product can be found in...</p>').insertBefore( $('#breadcrumbs p') )
			$('#breadcrumbs span').addClass(close_class);
			
			$('#breadcrumbs p:last').slideUp();
			
			$('#breadcrumbs p span').click( function() {
				if( $('#breadcrumbs p:last').css("display") == "none" ){
					$('#breadcrumbs p:last').slideDown();
					$('#breadcrumbs span').removeClass(close_class);
					$('#breadcrumbs span').addClass(open_class);
				} else {
					$('#breadcrumbs p:last').slideUp();
					$('#breadcrumbs span').removeClass(open_class);
					$('#breadcrumbs span').addClass(close_class);
				}
			});
			
		}
		
	}
	
	if( $('#worldmap').length > 0 ){
		
		i = 0;
		
		$('.target').click( function(){
			
			$(".link-bubble:visible").fadeOut();
			
			bubble = $(this).attr("id");
			$("#link_bubble-"+bubble).fadeIn();
			d=0;
			$("div#link_bubble-"+bubble+" span.close").click( function(){
				if( d == 0 ) $("#link_bubble-"+bubble).fadeOut();
				d++;
			});
			c=0;
			$('#worldmap').click( function(){
				if( i > 0 ){
					if( c == 0 ) $("."+bubble).fadeOut();
					c++;
				}
				
			});
			i++;
			
		});
		
	}
	
	jQuery(window).bind("load", function() {
		jQuery("div#slider1").codaSlider();
	});
	
});
