function img_overlay(){
	
	var $ = jQuery;

	if ( !$.browser.msie || $.browser.version == '9.0'){
		$('span.overlay, span.overlay_icon').fadeTo(0,0);

		$('span.overlay_icon').hover(function(){
			$(this).prev().stop().fadeTo(600,0.5);
			$(this).stop().fadeTo(600,1);
		},function(){
			$(this).add($(this).prev()).stop().fadeTo(600, 0);
		});
	}
	else if($.browser.version != '6.0') { /* IE 7 and 8 */
		$('span.overlay').fadeTo(0,0);
		$('span.overlay_icon').css('display','none');
		$('span.overlay').hover(function(){
			$(this).stop().fadeTo(600,0.5);
			$(this).next().css('display','block');
		},function(){
			$(this).next().css('display','none');
		});

		$('span.overlay_icon').hover(function(){
			$(this).css('display','block');
		},function(){
			$(this).css('display','none');
			$(this).prev().stop().fadeTo(600, 0);
		});
	}
}
jQuery(document).ready(function($) {
$('.sidebar .widget ul li:last-child').css('border-bottom', 'none');
$('#footer .widget ul li:last-child').css('border-bottom', 'none');

$('.post_brdr:last').css('display', 'none');

// Social Hover
jQuery('.social_box ul li a').hover(function () {
		jQuery(this).stop().animate({
		    opacity: '0.7'
		    }, 400);
		}, function () {
		jQuery(this).stop().animate({ opacity: '1'}, 300);
	});

jQuery(".portfolio a[rel^='prettyPhoto']").prettyPhoto({deeplinking: false});
jQuery(".gallery_pic li a[rel^='prettyPhoto']").prettyPhoto({deeplinking: false});
img_overlay(); 


//Equal Height
function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}




/*****************************
 *  Drop Down
*******************************/
	jQuery("ul.navigation a").removeAttr('title');
	jQuery(" ul.navigation ul").css({display: "none"}); // Opera Fix
	jQuery("ul.navigation li").each(function()
		{	
	var jQuerysubmeun = jQuery(this).find('ul:first');
	jQuery(this).hover(function()
		{	
	jQuerysubmeun.stop().css({overflow:"hidden", height:"auto", display:"none", paddingTop:0}).slideDown(250, function()
		{
	jQuery(this).css({overflow:"visible", height:"auto"});
		});	
		},
	function()
		{	
	jQuerysubmeun.stop().slideUp(250, function()
		{	
	jQuery(this).css({overflow:"hidden", display:"none"});
			});
		});	
	});


//External Links
  $("a[href^=http]").each(function(){
      if(this.href.indexOf(location.hostname) == -1) {
         $(this).attr({
            target: "_blank",
            title: ""
         });
      }
   });
  

//add to bookmarks
$("li.bookmark a").click(function(){
   var bookmarkUrl = this.href;
   var bookmarkTitle = this.title;
	 
   if ($.browser.mozilla) // For Mozilla Firefox Bookmark
   { 
	window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
   } 
   else if($.browser.msie || $.browser.webkit) // For IE Favorite
   { 
	window.external.AddFavorite( bookmarkUrl, bookmarkTitle); 
   }
   else if($.browser.opera ) // For Opera Browsers
   { 
	$(this).attr("href",bookmarkUrl);
	$(this).attr("title",bookmarkTitle);
	$(this).attr("rel","sidebar");
	$(this).click();
   } 
   else // for other browsers which does not support
   { 
        alert('Please hold CTRL+D and click the link to bookmark it in your browser.');
   }
   return false; 
});

//Read Book
	jQuery("a.read_link").prettyPhoto({deeplinking: false,
			default_width: 660,
			default_height: 700});

	jQuery(".addbook a").prettyPhoto({deeplinking: false,
			default_width: 699,
			default_height: 613
			
			});

	jQuery(".reqbook a").prettyPhoto({deeplinking: false,
			default_width: 699,
			default_height: 613
			
			});

  /******************************************
 *          shortcodes
 *****************************************/

//tip
  jQuery('.tip_s').tipsy({gravity: 's'});
  jQuery('.tip_n').tipsy({gravity: 'n'});
  jQuery('.tip_e').tipsy({gravity: 'e'});
  jQuery('.tip_w').tipsy({gravity: 'w'});

// custom Tabs 
	jQuery(".custom_tabs").tabs(".custom_tabs_content", {
		tabs: "li",
		effect:'fade'
	});

//Accordion
	jQuery(".accordion").tabs(".accordion .acc_content", {tabs: 'h2.acc_title', effect: 'slide', initialIndex: null});
	jQuery('.accordion .acc_title:first-child').addClass('current');
	jQuery('.accordion .acc_title.current').next('div.acc_content').css('display', 'block');

//Images
jQuery('a.lightbox_img img ').hover( function () {
			jQuery(this).stop().animate({ opacity: 0.8}, 300);

		}, function () {
			jQuery(this).stop().animate({ opacity: 1 }, 300);
		});


jQuery('.gallery .gallery-item img').hover( function () {
			jQuery(this).stop().animate({ opacity: 0.6}, 300);

		}, function () {
			jQuery(this).stop().animate({ opacity: 1 }, 300);
		});

	jQuery("a.lightbox_img").prettyPhoto({deeplinking: false});
	jQuery(".wp-caption a").prettyPhoto({deeplinking: false});

//DropDown
	jQuery(".navigation ul.nav ul a").removeAttr('title');
	jQuery(" .navigation ul.nav ul").css({display: "none"}); // Opera Fix
	jQuery(".navigation ul.nav li").each(function()
		{	
	var $submeun = jQuery(this).find('ul:first');
	jQuery(this).hover(function()
		{	
	$submeun.stop().css({overflow:"hidden", height:"auto", display:"none", paddingTop:0}).slideDown(250, function()
		{
	jQuery(this).css({overflow:"visible", height:"auto"});
		});	
		},
	function()
		{	
	$submeun.stop().slideUp(250, function()
		{	
	jQuery(this).css({overflow:"hidden", display:"none", zIndex:5000});
			});
		});	
	});
	jQuery(".navigation ul.nav ul li:last-child").css('border-bottom','none');
	jQuery(".navigation ul.nav ul li:last-child").addClass('roundbt');
      	jQuery('.navigation ul.nav li ul li ul').parent().append('<span class="drop_arrow"></span>');



//temp

//add to bookmarks
$("li.bookmark a").click(function(){
   var bookmarkUrl = this.href;
   var bookmarkTitle = this.title;
	 
   if ($.browser.mozilla) // For Mozilla Firefox Bookmark
   { 
	window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
   } 
   else if($.browser.msie || $.browser.webkit) // For IE Favorite
   { 
	window.external.AddFavorite( bookmarkUrl, bookmarkTitle); 
   }
   else if($.browser.opera ) // For Opera Browsers
   { 
	$(this).attr("href",bookmarkUrl);
	$(this).attr("title",bookmarkTitle);
	$(this).attr("rel","sidebar");
	$(this).click();
   } 
   else // for other browsers which does not support
   { 
        alert('Please hold CTRL+D and click the link to bookmark it in your browser.');
   }
   return false; 
});

/*	$('.news_line ul.news_ticker').serialScroll({
		items:'li',
		duration:100,
		axis:'x',
		interval:1, // yeah! I now added auto-scrolling
		step:2 // scroll 2 news each time
	});	
*/



});
