
$(document).ready( function(){
 	  
  	$('.block-title').corners("3px top");
  
  	$('.rounded').corners("3px top");
  
	$("div.clickable").click( function(){	
	    window.location = $(this).attr("url");
	    return false;
	});
	
	$("div.clickableExternal").click( function(){	
	    window.open($(this).attr("url"), '');	    
	    return false;
	});

	// tooltips	
	$('.tip').each(function() {
    	$(this).qtip({
        	content : $(this).attr("title"),
        	
        	style: { 
		      color: '#72553e',
		      padding: 2,
		      background: '#ebe8e5',
		      color: 'black',
		      textAlign: 'center',
		     
		      border: {
		         width: 1,
		         radius: 0,
		         color: '#72553e'
		      },
		      
		      tip: 'leftMiddle',
		      name: 'dark' // Inherit the rest of the attributes from the preset dark style
		  	  }

        	});
	});

  	$('#navigation ul li').corners("3px top");
	
	$(".tooltip").prepend('<img src="/twa/themes/basic/images/tooltip.png" />');
	
			// superfish script
	      	$("#superfish-inner ul").addClass("sf-menu sf-navbar");
	      	$("#superfish-inner ul").removeClass("menu");
	      
	        $("ul.sf-menu").superfish({
	            delay:       500,              // one second delay on mouseout
	            animation: 	{opacity:'show'},  // fade-in and slide-down animation animation:   {opacity:'show',height:'show'},
	            speed:       'fast',           // faster animation speed
	            autoArrows:  false,            // disable generation of arrow mark-up
	            dropShadows: false 				//,   //pathClass: "active-trail"	            
	        });
	          
	$('ul.sf-navbar li.active ul').addClass('subfish');
	         
	$("li.sf-breadcrumb:first").addClass("currentSection");
	  
	//unhide nav after page is loaded, smoother loading.       
	$('#superfish').show();


	// mimetype icons for downloads
		$(".view-content a[href$='.pdf']").addClass("pdf"); 
		$(".view-content a[href$='.doc'], a[href$='.txt'], a[href$='.rft']").addClass("doc");
		
		/* solutions page */
		$("#node-35 a[href$='.pdf']").addClass("pdf");
		$("#node-35 a[href$='.doc'], a[href$='.txt'], a[href$='.rft']").addClass("doc");
		
		/* understanding regulatory compliance */		
		$("#block-block-17 a[href$='.pdf'], a[href$='.PDF']").addClass("pdf");
		$("#block-block-17 a[href$='.doc']").addClass("doc");
		

});
