// Using jquery get all a tags with class of termsConditionsLink and add an on click to popup window
$(document).ready(function() {

    $('#noSubscribeForm input[type="text"]').focus(function() {
        if($(this).attr('value') == 'Email Address') {
           $(this).attr('value', ''); 
        }
    });
    
    $('#noSubscribeForm input[type="text"]').blur(function() {
        if($(this).attr('value') == '') {
           $(this).attr('value', 'Email Address'); 
        }
    });
    
    $('.introHome').css({opacity: 0});

    init();
});
function init() {
    $('a.popupLink').bind('click', function(e) { popupWindow($(this).attr('href'), $(this).attr('title').replace(/[^A-z]/ig, ''),'width=760, height=730, scrollbars'); e.preventDefault(); });
    $('a.quizPopup').bind('click', function(e) { 
        e.preventDefault();
        popupQuiz();
    });
}

/**
 * popup a new window
 */
function popupWindow(url, name, attributes){
	var newWindow = window.open(url, name, attributes);
	newWindow.focus();
}

function popupQuiz() {
    window.open("/quiz/index.html","noQuiz","menubar=1,resizable=1,width=800,height=600");
} 

function showDots() {
    $('.introHome').animate({opacity: 1.0}, 150, "swing");
}