function anim() {
    var divOffset = $('#poll_block').offset().top;
    var pOffset = $('#poll_block #poll_submit_button').offset().top;
    var pScroll = pOffset - divOffset;
    $('#poll_block').animate({scrollTop: '+=' + pScroll + 'px'}, 500);
    $('#poll_block #poll_submit_button').focus();
}
function sendPollForm(but) {
	$("#poll_submit_button").attr("disabled","disabled");   
	$.post("poll.php?action=answer", $(but).closest('form').serialize());
	$("#poll_block").fadeOut("slow",function(){  
		$("#poll_block").remove();  
		$.ajax({   
			url: "poll.php?action=refr",   
			cache: false,   
			success: function(html){   
				$("#poll_container").html(html); 
			}
		});
	});
	$("#poll_block").fadeIn("slow");
}

function MM_swapFaq(id) {
	var Span = document.getElementById ('faq' + id);
	Span.style.display = Span.style.display == 'block' ? 'none' : 'block';
}

function generalJsInit() {
	setupShowroomMovieRollovers();
	setupTogglesZZplus();
	addPrintEvents();

	/* START: SCM, 21/04/08 overlay */
	if (typeof flash_takeover == 'object') createFlashOverlay();
	var promos = $$('.homePromos img');
	if (promos.length !== 0) { /* UK specific */
		if (gup('over', promos[0].src) !== false) {
			homeStartCountdown();
		}
	}

	//UK promotion links
	if (Prototype.Browser.IE) {
		$$('.promoContainer a').each(function(el) {
			Event.observe(el, 'focus', linkBlurring, false);
		});
	}
	
	// Brochure download links:
	$$('#content ol.js-brochure-download ul.links a').invoke('observe', 'click', function (e) {
		// grab the href and open a new window
		var link = Event.element(e);
		link = link.href;
		if (link) window.open(link);
		// let the postback onclick fire
	});
	
	
	contentpanels.init();
	tracking.onPageLoad();
}

// Top navigation navigation
sfHover = function() {
	if (document.getElementById("nav") !== null) {
		var sfEls = document.getElementById("nav").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);
// End: Top navigation navigation

$(document).ready(function () {
	$('.popupTextLinkerSel').removeClass("popupTextLinkerSel").addClass("popupTextLinker");
	$('.popupTextLinker').next('.popupText').css("display","none");
});
function popupText(linker) {
	if($(linker).next('.popupText').css("display")=="none"){Selected=1}else{Selected=0};
	$('.popupTextLinkerSel').next('.popupText').css("display","none");
	$('.popupTextLinkerSel').removeClass("popupTextLinkerSel").addClass("popupTextLinker");
	if(Selected==1){
		$(linker).next('.popupText').css("display","block");
		linker.className="popupTextLinkerSel";
	}else{
		$(linker).next('.popupText').css("display","none");
		linker.className="popupTextLinker";
	}
};
