$(document).ready(function() {
    
    $('#headerSearch').focus(function() {
        if($(this).attr('value') == 'Enter Keywords') {
           $(this).attr('value', ''); 
        }
    });
    $('#headerSearch').blur(function() {
        if($(this).attr('value') == '') {
           $(this).attr('value', 'Enter Keywords'); 
        }
    });
    
    $('#cmSubscribeForm a').click(function(e) {
        e.preventDefault();
        inputVal = $('.cmInput').attr('value');
        if(inputVal == '') {
            alert("Please Enter your email address");
        } else {
            $('#cmSubscribeForm').submit();
        }
    });

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

});

function popupWindow(url, name, attributes){
	var newWindow = window.open(url, name, attributes);
	newWindow.focus();
}