jQuery(document).ready(function($) {
// function for dropdowns since IE doesn't recognize hover on non-anchor elements
	$('#header-nav> li,#header-nav> .sub-menu> li').hover(
		function () {  
			//show its submenu  
			$(this).className='hover';
			$(this).addClass('hover');  
		},   
		function () {  
			//hide its submenu  
			$(this).removeClass('hover');
		}  
	);
	$('#loginform .title').append(' or <a class="simplemodal-register" href="http://www.sevenoaksnativenursery.com/wp-login.php?action=register" title="Click here to register an account">Click Here to Register</a>');
	$('#registerform .simplemodal-login-fields').prepend('<p>Please choose a username and password for your account.</p><br />');
});

jQuery(window).load(function() {
	var initHeight = jQuery('#slideshow').children('a').height();
	jQuery('#slideshow').css("height",initHeight)
	
	jQuery("#slideshow").cycle({
		pager:  '#thumbnails',
		timeout: 0,
		pagerClick: function(idx, slide){
			jQuery('#slideshow').animate({height: jQuery(slide).height()});
		},
		containerResize:0,
	
		// callback fn that creates a thumbnail to use as pager anchor 
		pagerAnchorBuilder: function(idx, slide) {
			var thumb = jQuery(slide).attr('href');
			var thumbDot = thumb.lastIndexOf('.');
			var thumbSRC = thumb.substr(0,thumbDot) + "-100x100" + thumb.substr(thumbDot);
			return '<a href="#" title="Click to enlarge"><img src="' + thumbSRC + '" class="content-thumbphoto" /></a>';
		}
	});
});

