// JavaScript Document

$(document).ready ( function () {
$("#pageflip").hover(function() {//On hover...
		//hide the select list in the search box to stop it poking through in IE6
		if (jQuery.browser.msie) {
			if(parseInt(jQuery.browser.version) == 6) {
				$("#edit-search-select").hide();
			}
		}
		
		$("#hover-subscribe").show();
		if (jQuery.browser.msie) {
			if(parseInt(jQuery.browser.version) == 7) {
				$("#pageflip img").css("z-index","0");
			}
		}		
		
		$("#pageflip img , .msg_block").stop()
			.animate({ //Animate and expand the image and the msg_block (Width + height)
				width: '307px',
				height: '308px'
			}, 500);
		
		//alert(document.getElementById('subscribe').style.zIndex);
		} , 
		function() { 
			//this line restores the search select box on hoverout, could not do with jquery because 
			//IE6 was not recognising the code
			if (jQuery.browser.msie) {
				if(parseInt(jQuery.browser.version) == 6) {
					document.getElementById('edit-search-select').style.display = '';
				}
				
				if(parseInt(jQuery.browser.version) == 7) {
					$("#pageflip img").css("z-index","99");
				}
			}
			
			$("#hover-subscribe").hide();
			$("#pageflip img").stop() //On hover out, go back to original size 50x52
				.animate({
					width: '40px',
					height: '40px'
				}, 220);
			
			$(".msg_block").stop() //On hover out, go back to original size 50x50
				.animate({
					width: '40px',
					height: '40px'
			}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
	}); });


function initialiseNewsTicker(id) {
	$(document).ready(function() {
		var options = {
	  		newsList: "#"+id,
	 		startDelay: 10,
	 		placeHolder1: " []",
			stopOnHover: false,
			controls: false
		}
		$().newsTicker(options);
		$('.news-ticker-wrapper .title').show();
	});
}

