//Button rollover==============================================================================================
window.onload = rolloverInit;

function rolloverInit(){
	
for (var i=0; i<document.images.length; i++)
	{
		if(document.images[i].title == "menu")
			{setupRollover(document.images[i]);}
	}
}

function setupRollover(thisImage){
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = rollOut;
	
	thisImage.overImage = new Image();
	thisImage.overImage.src = "images/" + thisImage.id + "_roll.jpg";
	thisImage.onmouseover = rollOver;
}

function rollOver()
{
	this.src = this.overImage.src;
}

function rollOut()
{
	this.src = this.outImage.src;
}

//Fancybox and sliding banner==================================================================================
jQuery(document).ready(function() {
								
//Feature Event Page Make-Up Bar=========================================================
$("#feateventmakeup").click(function() {
		$.fancybox([
			'photos/2010makeup/nikki13.jpg',
			'photos/2010makeup/nikki36.jpg',
			'photos/2010makeup/nikki61.jpg',
			'photos/2010makeup/nikki4.jpg',
			{
				'href'	: 'photos/2010makeup/nikki43.jpg',
				'title'	: 'Make-Up Bar 2010 - Magnolia Hotel; Photos: Del*Nique Works'
				},
			{
				'href'	: 'photos/2010makeup/nikki16.jpg',
				'title'	: 'Make-Up Bar 2010 - Magnolia Hotel, Photos: Del*Nique Works'
			}
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'changeFade'        : 0
		});
	});//end feateventmakeup


//Sliding banner================================================================================================
$("#feature").easySlider({
					auto: true, 
					continuous: true,
								
				vertical:		false,
				controlsShow:	false
				});	
								});

//AJAX Form Submit===================================================================================
jQuery(document).ready(function() {
	$("#submit").click(function(e){
				//Stop the form from submitting until ready
				$("#msg").hide();
				e.preventDefault();
				//declares a variable and assigns it the value of what is placed in the input box
				var fname = $("#fname").val();
				var lname = $("#lname").val();
				var job = $("#job").val();
				var bday = $("#bday").val();
				var location = $("#location").val();
				var hphone = $("#hphone").val();
				var mphone = $("#mphone").val();
				var email = $("#email").val();
				var web = $("#website").val();
				var facebook = $("#facebook").val();
				var ename = $("#ename").val();
				var enumber = $("#enumber").val();
				var bio = $("#bio").val();
				var news = $("#news").val();
				var disclaim = $("#disclaim").val();
				
					$("#msg").css({"visibility": "visible","border":"#F9F9F9", "background-color":"#f9f9f9"}).fadeIn();
					$("#msg").html("<img src=\"images/loading.gif\" alt=\"Loading\" /><span style=\"color: #F00000;\">LOADING....</span>");
				
					//An loading gif or image can be placed here or a message letting the user now about the submitted information
					//$("#msg").html("<img src="" alt="" />");	
					//or
					//$("#msg").html("SUCCESS");
					//or
					//$("#msg").html(value);
					//or
					
					//Ajax function to submit the information
					$.ajax({
						type: 'post', //How you will send the data "POST" or "GET"
						url:  'process.php',	//Link to the txt, xml or php page that will process the data
						data: $('#joinForm').serializeArray(), //The value you want to send to the processing script
						cache: false,
						success: function(data){
							$("#msg").html(data).css({"border":"#555 medium solid", "background-color":"#f00000", "color": "#fff"}).fadeIn();
							$("#msg").html("Your Message has been sent. A professional stylist will reply shortly.");
							fname = $("#fname").val('');
							lname = $("#lname").val('');
							job = $("#job").val('');
							month = $("#month").val('');
							day = $("#day").val('');
							year = $("#year").val('');
							city = $("#city").val('');
							zip = $("#zip").val('');
							hphone = $("#hphone").val('');
							mphone = $("#mphone").val('');
							email = $("#email").val('');
							web = $("#website").val('');
							facebook = $("#facebook").val('');
							ename = $("#ename").val('');
							enumber = $("#enumber").val('');
							bio = $("#bio").val('');
							news = $("#news").val('');
							disclaim = $("#disclaim").val('');
								}
				});//end ajax
		});//end submit function


//Events Paypal Ticket Purchase ===========================================================================================
jQuery(document).ready(function(){			
			$("#tixopen").click(function()
			{
				$("#paypal_bg").fadeIn(300);
				$("#paypal_button").fadeIn(300);
			});
			
			$("#tixclose").click(function()
			{
				$("#paypal_button").fadeOut(300);
				$("#paypal_bg").fadeOut(300);
			});

});


jQuery(document).ready(function(){	
								
		$("#explain").css("display","none");
			// Add onclick handler to checkbox w/id checkme
	    $("#checkno").click(function(){

		// If checked
		if ($("#checkno").is(":checked"))
		{
			//show the hidden div
			$("#explain").show("fast");
		}
		else
		{
			//otherwise, hide it
			$("#explain").hide("fast");
		}
	  });
		
		$("#checkyes").click(function(){
		if($("#checkyes").is(":checked"))
		{
			//otherwise, hide it
			$("#explain").hide("fast");
		}
		});
		
});
		
});//end jquery doc function
