// index functions 

// superfish menu

 $(document).ready(function(){ 
        $("ul.sf-menu").superfish({ 
            pathClass:  'current',
			 delay:       1000,                           // one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       250,                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: true                            // disable drop shadows 
        }); 
    }); 
	
	
	// add classes
	
	$(document).ready(function() {
				$('ul#topnav > li:first-child > a').addClass('first');
				$('ul#topnav > li:last-child > a').addClass('last');
				$('.sf-navbar > li').addClass('top');	
				$('.sf-navbar li.top > ul').addClass('second');
				$('.sf-navbar li.top > a').addClass('sfHover');
				$('.sf-navbar li.top > a').addClass('top');
				$('.sf-menu ul ul li:last-child').addClass('lastround');
				$('div.group > div.section:last-child').addClass('last-col');
				var leftdiv = $("<span class='top-left'></span>");
						$("li.top > a").prepend(leftdiv);		
				var rightdiv = $("<span class='top-right'></span>");
						$("li.top > a").append(rightdiv);	
			
			});
	
	// browser resolution
	
//	function adjustStyle(width) {
  //  width = parseInt(width);
   // if (width < 740) {
   //     $("#size-stylesheet").attr("href", "themes/keravanenergia/css/narrow.css");
   // } else if ((width >740) && (width < 820)) {
   //     $("#size-stylesheet").attr("href", "themes/keravanenergia/css/medium.css");
	//} else if ((width >= 820) && (width < 980)) {
   //     $("#size-stylesheet").attr("href", "themes/keravanenergia/css/normal.css");
   //// } else {
       $("#size-stylesheet").attr("href", "themes/keravanenergia/css/wide.css"); 
   // }
//}


function adjustStyle(width) {
    width = parseInt(width);
    if (width < 960) {
        $("#size-stylesheet").attr("href", "themes/keravanenergia/css/narrow.css");
    } else {
       $("#size-stylesheet").attr("href", "themes/keravanenergia/css/wide.css"); 
    }
}

$(function() {
    adjustStyle($(this).width());
    $(window).resize(function() {
        adjustStyle($(this).width());
    });
});
	
	

 // DD_roundies
  
 	DD_roundies.addRule('#top-image-box', '50px 0px 50px 0px', true); 
	DD_roundies.addRule('#top-image-box img', '45px 0px 45px 0px', true);
	DD_roundies.addRule('.round-box', '50px 0px 50px 0px', true); 
	DD_roundies.addRule('.boximg', '14px', true); 
	DD_roundies.addRule('.boximg img', '10px 10px 10px 10px', true); 
	DD_roundies.addRule('.readmore a', '10px 10px 10px 10px', true); 









