// <![CDATA[
var $scriptjs = jQuery.noConflict();

$scriptjs(function() {
		   

	// wrap 'span' to nav page link
	$scriptjs('.topnav ul').children('li').each(function() {
		$scriptjs(this).children('a').html('<span>'+$scriptjs(this).children('a').text()+'</span>'); // add tags span to a href
	});
	


	// Superfish tabs
	$scriptjs("ul.sf-menu").superfish({
		autoArrows:  false,
		delay:       400,                             // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                          // faster animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
		dropShadows: false                            // disable drop shadows
	}); 
	
	$scriptjs('ul.list li').each(function() {
	  var a = $scriptjs(this).children('a');
	  var aClass = a.attr('rel');
	  if (a.hasClass('active')) {     
	   $scriptjs('.'+aClass).css({'display':'block'});
	  } else {
	   $scriptjs('.'+aClass).css({'display':'none'});
	  }
	 });
	 $scriptjs('ul.list li a').click(function () {
	  var thisaClass = $scriptjs(this).attr('rel');
	  $scriptjs(this).parent('li').parent('ul').children('li').each(function() {
	   var a = $scriptjs(this).children('a');
	   var aClass = a.attr('rel');
	   if (thisaClass == aClass) {
		$scriptjs('.'+aClass).show();
		a.attr('class','active');
	   } else {
		$scriptjs('.'+aClass).hide();
		a.attr('class','');
	   }
	  });
	  return false;
	});

});

Cufon.replace('.contentheading, h1, .info_l, .info_r, .logo small, .arrow_com p , #header .graybutton a, .logo small, .post-title h2 a, .wtitle h2, #header .bigtext, .content .index-right h2, .index h2, .post-comments a, .header3  .rss_but a, .box h2, .box h3, .box-white h3, .moduletable-clean h3, a.comm', { hover: true });

// ]]>
