jQuery(document).ready(function() {						   
						   
	jQuery('#slideshow').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 5000,
        pager:  '#slider_nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#slider_nav li:eq(' + (idx) + ') a';
        }
    });
						   
	jQuery("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 			
	}); 
	
	jQuery('ul.list li').each(function() {
	  var a = jQuery(this).children('a');
	  var aClass = a.attr('rel');
	  if (a.hasClass('active')) {     
	   jQuery('.'+aClass).css({'display':'block'});
	  } else {
	   jQuery('.'+aClass).css({'display':'none'});
	  }
	 });
	 jQuery('ul.list li a').click(function () {             
	  var thisaClass = jQuery(this).attr('rel');
	  jQuery(this).parent('li').parent('ul').children('li').each(function() {
	   var a = jQuery(this).children('a');
	   var aClass = a.attr('rel');
	   if (thisaClass == aClass) {
		jQuery('.'+aClass).show();
		a.attr('class','active');
	   } else {
		jQuery('.'+aClass).hide();
		a.attr('class','');
	   }
	  });
	  return false;
	});
	
		  
	// radius Box
	jQuery('.social-links').css({"border-radius": "5px", "-moz-border-radius":"5px", "-webkit-border-radius":"5px"});
	jQuery('.wp-pagenavi a, .wp-pagenavi .current ').css({"border-radius": "5px", "-moz-border-radius":"5px", "-webkit-border-radius":"5px"});
	
	// wrap 'span' to nav page link
	jQuery('.topnav ul').children('li').each(function() {
		jQuery(this).children('a').html('<span>'+jQuery(this).children('a').text()+'</span>'); // add tags span to a href
	});
	
});

