$(document).ready(function(){

    $('a.thickbox').each(function(){
      $(this).attr('href',$(this).attr('href')+'?width=525&height=491');
    });

    $('.thickbox-close').live('click',function(){
        tb_remove();
        return false;
    });

    $('#Content #EnterNowBackground #ProductPurchased li label').tooltip({
        bodyHandler: function() {
            return $(this).next('span').html();
        },
        showURL: false}
    );

    $("div#scrollingText").smoothDivScroll({autoScrollSpeed: 1,autoScroll: "always",autoScrollDirection: "endlessloop",pauseAutoScroll: "mousedown"});

    $('a.external').attr('title','Opens in a new browser window');

    $('a.external').click(function(){
       window.open(this.href,'printWin','left=50,toolbar=yes,scrollbars=yes,location=yes,status=yes,menubar=yes,resizable=yes');
       return false;
    });

	$('#Questions h2').each(function(){
		$(this).attr('title','Click to open/close');
	});

    $('#Questions h2').click(function(){
        $(this).next('.content').slideToggle();
        return false;
    });

    $("#ShowHide a").click(function(){
        $('.content').slideToggle();
        return false;
    });
    
    // fix for IE label/image problem
    $("#ProductPurchased label").click(function(){
    	$(this).prev('input').attr('checked','checked');
    });
    
    /* fixes for IE png swaps
    -------------------------------------------------------------- */
    
    $('#FindOutMore, #TermsAndConditions, #Partner #EnterNow, #Links li, #LunchClub').click(function(){
    	document.location.href = $(this).children('a').attr('href');
    });
    
	$('#SeeProductRange').click(function(){
		window.open($(this).children('a').attr('href'),'printWin','left=50,toolbar=yes,scrollbars=yes,location=yes,status=yes,menubar=yes,resizable=yes');
		return false;
    });
    
    $('#FindOutMore, #SeeProductRange, #TermsAndConditions, #EnterNow, #Links li, #LunchClub').hover(function(){
		$(this).css('cursor','pointer');
    });

});