$(document).ready(function() {	
	
	$("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
	}); 
	
	// wrap 'span' to nav page link
	$('.topnav ul').children('li').each(function() {
		$(this).children('a').html('<span>'+$(this).children('a').text()+'</span>'); // add tags span to a href
	});
	$('#nav1 ul').children('li').each(function() {
		$(this).children('a').html('<span>'+$(this).children('a').text()+'</span>'); // add tags span to a href
	});
	
	$('#slideshow').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 10000,
		pause: true,
		random: 0,
        pager:  '#slider_nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#slider_nav li:eq(' + (idx) + ') a';
        }
    });
	
	$('#rsi_content').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 10000,
		pause: true,
		random: 1,
        pager:  '#slider_nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#slider_nav li:eq(' + (idx) + ') a';
        }
    });
	
	$('#productshow').cycle({
        fx:     'fade',
        speed:  'slow',
        before: hideProductName,
		after: showProductName,
		delay: 0,
		pause: true,
		random: 1,
		sync: true
    });
	
	function showProductName() { 
   	 	$('#productname').html("<h2>" + $(this).attr('alt') + "</h2>"); 
	} 
	
	function hideProductName() { 
    	$('#productname').html(""); 
	}
	
	$('#productlightbox').hide();
	$('#productlightbox2').hide();
	$('#productlightbox3').hide();
	$('#productlightbox4').hide();
	
	$('.news-show').cycle({ 
    	fx: 'scrollHorz',
    	sync: 1,
    	pause: true,
		timeout: 5000,
    	next:   '#next2', 
    	prev:   '#prev2',
	});

// radius Box   
 	$('.post-commets span').css({"border-radius": "5px", "-moz-border-radius":"5px", "-webkit-border-radius":"5px"});
	$('#nav1 ul.sf-menu li ul.children, #nav1 ul.sf-menu li a').css({"border-radius": "5px", "-moz-border-radius":"5px", "-webkit-border-radius":"5px"});
	$('.wp-pagenavi a, .wp-pagenavi .current').css({"border-radius": "5px", "-moz-border-radius":"5px", "-webkit-border-radius":"5px"});

});

function show_testimonial(id) {
	$(".testimonial").hide();
	$('#' + id).show('slow');
}

