/****************************************
$().ready()
- this function is triggered when all page elements have been loaded
and are ready to be manipulated. just like onload="init()"
****************************************/
$().ready(function(){


 //$("img[@src$=png]").pngfix();

/*any img with class .hover get's replaced by it's imagename_on analog
*/
//Special offers button
  if($("#cr-special-but").length) {
    $("#cr-special-but").pngfix();
    $("#cr-special-but").hover(function() {
      $(this).addClass('cr-special-but-over');
    }, function() {
      $(this).removeClass('cr-special-but-over');
    }).click(function() {
    	alert('To implement special offer button');
    	return false;
    });
  }
  
//Sign up submit
  if($("#but-sign").length) {
    $("#but-sign").pngfix();
    $("#but-sign").hover(function() {
        $(this).attr("src", "img/but-sign_on.png");
    }, function() {
        $(this).attr("src", "img/but-sign.png");
    }).click(function() {
    	alert('To implement sign up form');
    	return false;
    });       
  }	
//Visit Learning Path
  if($("#cr-visit-lp").length) {
    $("#cr-visit-lp").pngfix();
    $("#cr-visit-lp").hover(function() {
        $(this).addClass('cr-visit-lp-but-over');
    }, function() {
        $(this).removeClass('cr-visit-lp-but-over');
    }).click(function() {
    	document.location.href ="http://www.leapfrog.com/learningpath";
    });       
  }	
  //signup form background
  if($(".call1").length) {  
    $(".call1").pngfix();    
  }
});

$(window).bind('load', function() {
  $.preloadImages("../img/but-special.png", "../img/but-sign.png", "..img/but-visit-lp_on.png");
});

