// patched: 2.8 compatible
// do not edit this file, it is created by the theme, any edits will be lost

window.patched = 1;

sfHover = function() {
	var sfEls = document.getElementById("topnav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover); // for MSIE only


jQuery(document).ready(function(){
		
		jQuery(".comments-count").click(function(){
		$thisclick = jQuery(this);
		var comments_id = "#"+$thisclick.parents(".entry-comments").attr("id");
		if ( jQuery(comments_id+" p.comment").size() > 0 ) {
			jQuery(comments_id).toggleClass('comments-count-active');
			jQuery(comments_id+" .comments-body").slideToggle(400);
		}
	});			
		
	 
	jQuery('.comments-count p:not(.no-comments)').mouseover(function(){
		old_hover = jQuery(this).css('color');
		old_dec = jQuery(this).css('text-decoration');
		jQuery(this).css('color', '');
		jQuery(this).css('text-decoration', 'underline'); 
	}).mouseout(function(){
		jQuery(this).css('color', old_hover);
		jQuery(this).css('text-decoration', old_dec); 
	});
	
		
	jQuery('#topnav li ul a').attr('title', '');
	
	// add arrow to dropdown with nested menu
	jQuery('#topnav li ul li:has(ul)').each(function(){
		$link = jQuery(this).children('a');
		linktext = $link.html();
		$link.html(linktext+" &raquo;");
	});
	// add underline to parent while child is being viewed
	jQuery('#topnav li ul li ul').hover(function(){
		jQuery(this).parent().children('a').css('text-decoration', 'underline');
	},function(){
		jQuery(this).parent().children('a').css('text-decoration', 'none');
	});
	
		if (!jQuery.browser.msie) {	
		jQuery('#topnav li ul').css('opacity', 0.93);
	}
	if (jQuery.browser.msie) {
		if (jQuery('#topnav li ul li:has(ul)').size() == 0) {
			jQuery('#topnav li ul').css('opacity', 0.93);
		}
	}
		
	jQuery('.entry-post:last').css('border', 'none');
	var padding = jQuery('body.single .entry-content').css('padding-bottom');
	jQuery('.entry-post:last').css('padding-bottom', '0');
	jQuery('.entry-post:last').css('background-image', 'none');
			
	jQuery('a#hidden-bio').click(function(){
		 
		jQuery('#bio').slideToggle(350,function(){
			jQuery('#bio-outer').css('display', 'block');
			jQuery('#biocolumns').css('display', 'inline');
			jQuery('.biocolumn').css('display', 'block');
			});
	});	
		if (typeof(jQuery.fn.lazyload) == 'function') {
		if (!jQuery.browser.msie) {	    
		    jQuery(".entry-content img").lazyload({
				effect : "fadeIn",
				threshold : 1500,
				placeholder : "http://www.scottlandphotography.com/blog/wp-content/themes/prophoto2/images/nodefaultimage.gif" 
			});
		}
	}		
	 
	jQuery('.alignnone, .aligncenter, .alignright, .alignleft, .gallery img, a[href$=.jpg], a[href$=.gif], a[href$=.png], a[href$=.JPG], a[href$=.GIF], a[href$=.PNG]')
		.css('cursor', 'default')
		.click(function(){return false;})		.bind('contextmenu', function(){return false;}
	);
		
	
			 
});

// flash header area
var params = {
	FlashVars: "path2xml=http://www.scottlandphotography.com/blog/wp-content/uploads/p2/images.xml?62399",
	bgcolor: "#000000",
	wmode: "opaque"
}
if ( window.swfobject ) {
swfobject.embedSWF("http://www.scottlandphotography.com/blog/wp-content/themes/prophoto2/flash/flashheader.swf", "flash-header", "786", "204", "7.0.0", "http://www.scottlandphotography.com/blog/wp-content/themes/prophoto2/flash/expressinstall.swf", false, params);
}

