// RESOLVE CONFLICT BETWEEN JQUERY AND OTHER LIBS
jQuery.noConflict();
// Slide animation
function slide(navigation_id, pad_out, pad_in, time, multiplier)
{
	// creates the target paths
	var list_elements = navigation_id + " li.sliding-element";
	var link_elements = list_elements + " a";

	// initiates the timer used for the sliding animation
	var timer = 0;

	// creates the slide animation for all list elements
	jQuery(list_elements).each(function(i)
	{
		// margin left = - ([width of element] + [total vertical padding of element])
		jQuery(this).css("margin-left","-180px");
		// updates timer
		timer = (timer*multiplier + time);
		jQuery(this).animate({ marginLeft: "0" }, timer);
		jQuery(this).animate({ marginLeft: "15px" }, timer);
		jQuery(this).animate({ marginLeft: "0" }, timer);
	});

	// creates the hover-slide effect for all link elements
	jQuery(link_elements).each(function(i)
	{
		jQuery(this).hover(
		function()
		{
			jQuery(this).animate({ paddingLeft: pad_out }, 150);
		},
		function()
		{
			jQuery(this).animate({ paddingLeft: pad_in }, 150);
		});
	});
}

// Verify contact form
function verifycontactform(){
	var msg='';

	if(document.getElementById('txtname').value==''){
	msg+=' Name';
	jQuery('#txtname').addClass('txtbox_invalid');
	}
	else 
	{
	jQuery('#txtname').removeClass('txtbox_invalid');
	}

	if(document.getElementById('txtemail').value=='')
	{
		msg+=', Email';
		jQuery('#txtemail').addClass('txtbox_invalid');
	}
	else
	{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('txtemail').value)){
			jQuery('#txtemail').removeClass('txtbox_invalid');
		}
		else { 
		jQuery('#txtemail').addClass('txtbox_invalid');
		msg+=', Email'; 
		}
	}


	if(document.getElementById('txtmessage').value==''){
		jQuery('#txtmessage').addClass('txtbox_invalid');
	msg+=', Message';}
	else 
	{
	jQuery('#txtmessage').removeClass('txtbox_invalid');
	}
	
	if (msg !='')
	{
	document.getElementById('send_confirm').innerHTML = "Please fill in all the information.";
	return false; 
	}
	else return true;

}

jQuery(document).ready(function(){
/*Home page slider*/
	
	/*Init the sliding menu*/
	slide("#sliding-navigation", 25, 15, 150, .8);
	/*Initiate all lightbox*/
	jQuery('.albums a').lightBox();
	
	
	/*Menu animations*/
	/*jQuery(".menu").hover(function()
	{
	jQuery(".menu div").fadeIn(200);
	jQuery(".menu #hiddenmenutext").fadeOut(0);
	jQuery(".menu #menuh1").fadeIn(0);
	},
	function()
	{
	jQuery(".menu div").fadeOut(200);
	jQuery(".menu #hiddenmenutext").fadeIn(0);
	jQuery(".menu #menuh1").fadeOut(0);
	}
	);*/

	/*Make all gallery types picture fade*/
	jQuery(".boxgrid").fadeTo("fast",0.6);
	jQuery(".boxgrid").hover(function()
	  {
		  jQuery(this).stop().fadeTo(10,2.0);
	  },
	  function()
	  {
		  jQuery(this).stop().fadeTo(10,0.6);
	  }
	  );
	/*Make all gallery types small picture fade*/
	jQuery(".boxgridS").fadeTo("fast",0.6);
	jQuery(".boxgridS").hover(function()
	  {
		  jQuery(this).stop().fadeTo(10,2.0);
	  },
	  function()
	  {
		  jQuery(this).stop().fadeTo(10,0.6);
	  }
	  );

	
	//For gallery
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute  

    //Full Caption Sliding (Hidden to Visible)  
    jQuery('.boxgrid.captionfull').hover(function(){  
        jQuery(".cover", this).stop().animate({top:'110px'},{queue:false,duration:150});  
    }, function() {  
        jQuery(".cover", this).stop().animate({top:'160px'},{queue:false,duration:150});  
    });  
    //Full Caption Sliding (Hidden to Visible)  FOR SMALL GALLERY NAVIGATION
    jQuery('.boxgridS.captionfull').hover(function(){  
        jQuery(".cover", this).stop().animate({top:'25px'},{queue:false,duration:150});  
    }, function() {  
        jQuery(".cover", this).stop().animate({top:'50px'},{queue:false,duration:150});  
    });  
    

//Create portrait slideshow
	jQuery(window).bind("load", function() {
	jQuery("div#mygalone").slideView()
	});

});

