/**
 * General Functions
 **/
this.image_tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.image_tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='image_tooltip'><img src='"+ this.t +"' /></p>");
		$("#image_tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#image_tooltip").remove();
    });	
	$("a.image_tooltip").mousemove(function(e){
		$("#image_tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

// starting the script on page load
$(document).ready(function(){
	image_tooltip();
	$(".tooltip").simpletooltip();
	
	$('li:first-child').addClass('first');
	$('li:last-child').addClass('last');


  window.setTimeout('check_logininput_UserPassword()', 1000);
  window.setTimeout('check_logininput_UserEmail()', 1000);


  $(".mamis_babys_movie").click(function() {
	$.fancybox({
			'padding'		: 0,
      'centerOnScroll' : true,
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 640,
			'height'		: 385,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'false'
			}
		});

	return false;
});

});


function check_logininput_UserEmail() {
  if ($('#UserPassword').val() != "") {
     $('#UserPassword').addClass("hideBG");
  } else {
    window.setTimeout('check_logininput_UserPassword()', 1000);
  }
}

function check_logininput_UserPassword() {
  if ($('#UserEmail').val() != "") {
     $('#UserEmail').addClass("hideBG");
  } else {
    window.setTimeout('check_logininput_UserEmail()', 1000);
  }
}

/**
 * Function to clear a form field on click if value is not initial value         
 **/
function clearField(field, initValue) {
  if ($(field).val() == initValue) {
    $(field).val('');
  }
}


function mamis_babys_movie() {
   
}