﻿$(document).ready(function() {
    
	/* * * * * * * * * * * * * * * * * * * * *
	 * Input boxes focus and blur
 	 * * * * * * * * * * * * * * * * * * * * */
	$("div.input input").focus( function() { $(this).css("border", "1px  solid #AAAAAA").css("color", "#1e2065").css("background", "#FFFFBB"); } );
	$("div.input input").blur( function() { $(this).css("border", "1px inset #AAAAAA").css("color", "#666666").css("background", "#EEEEEE"); } );
    
    $('div.submit input').unbind('focus', 'blur', 'click');
    
	/* Add red asterisks to required fields */
	$('div.required label').append('<span class="red">*</span>');


    

     /* * * * * * * * * * * * * * * * * * * * *
	 * Add fancybox boxes to certain links
 	 * * * * * * * * * * * * * * * * * * * * */
    $("a.fancybox1").fancybox({
    	'width'			    : 950,
    	'height'			    : 400,
    	'autoScale'	    : true,
        'centerOnScroll' : true, 
    	'transitionIn'		: 'elastic',
    	'transitionOut'	: 'elastic',
    	'type'				: 'iframe',
        'padding'            : 10
    });
    
    $("a.fancybox2").fancybox({
    	'width'			    : 600,
    	'height'			    : 500,
    	'autoScale'	    : true,
		'speedIn'           : 0,
		'speedOut'         : 0,
        'centerOnScroll' : false
    });


    $("a#forgot-password").fancybox({
    	'width'			    : 400,
    	'height'			    : 300,
    	'autoScale'	    : false,
    	'transitionIn'		: 'elastic',
    	'transitionOut'	: 'elastic',
    	'type'				: 'iframe',
        'padding'            : 10
    });

    $("a.howtoplay").fancybox({
    	'width'			    : 400,
    	'height'			    : 280,
    	'autoScale'	    : false,
    	'transitionIn'		: 'elastic',
    	'transitionOut'	: 'elastic',
    	'type'				: 'iframe',
        'padding'            : 10
    });

	/* prevents all images from being dragged */
	$("img").mousedown(function(event){
	  event.preventDefault();
	});


});


function popup(url) {
	newwindow=window.open(url,'name','width=600,height=400');
	if (window.focus) {newwindow.focus()}
	return false;
}

/*if ($this->Session->read('User.isEligibleToPlay') != 'yes')*/
function getHintMessage(param) {
    if (param == 'yes') {
        return true;
    } else {
        $('div#history-play-once').attr('class','display');
        return false;
    }
}



