

	$("yo > a").click( function () {
	return false;
	});
	
	function initgallery(number,dir)
	{
	current = 01;
	img_load = new Image();
	img_preload = new Image();
	maximum=number;
	directory=dir;
	img_load.src=directory+'01.jpg';
	img_load.onload = function()
                      {
			  $(".load").fadeTo(0, 0);				  						document.img_1.src=directory+'01.jpg';
			 $(".load").fadeTo("fast", 1);
                      };
	updatenavigation(current);
	}
	
	function makeThat2(num)
	{
	if(num<10) return "0"+num;
	else return ""+num;
	}
	
	function updatenavigation(cur)
	{
	if(maximum==01)
		{
		document.getElementById('previd').style.display='none';
		document.getElementById('nextid').style.display='none';
		}
		else
			{
			if(current==01)
				{			  
				document.getElementById('previd').style.display='none';
				document.getElementById('nextid').style.display='';
				}
			if(current==maximum)
				{			  
				document.getElementById('nextid').style.display='none';
				document.getElementById('previd').style.display='';
				}
			if((current>01)&&(current<maximum))
				{
				document.getElementById('nextid').style.display='';
				document.getElementById('previd').style.display='';
				}
			}
		
	}
		
		
			
	function nextimage() {
	if(current==maximum){alert('No more images.');; return false;}
	document.img_1.src='loader.gif'; 
	current++;
	updatenavigation(current);
	img_load.src=directory+makeThat2(current)+'.jpg';
	img_load.onload = function()
                      {
					  $(".load").fadeTo(0, 0);
					  document.img_1.src=directory+makeThat2(current)+'.jpg';
					  $(".load").fadeTo("fast", 1);
					  img_preload.src=directory+makeThat2((current+1))+'.jpg';
					  
                      };
	return false;
 	}
	
	function previousimage() {
	document.img_1.src='loader.gif';
	current--;
	updatenavigation(current);
	img_load.src=directory+makeThat2(current)+'.jpg';
	img_load.onload = function()
                      {
					  $(".load").fadeTo(0, 0);
                      document.img_1.src=directory+makeThat2(current)+'.jpg';
					  $(".load").fadeTo("fast", 1);
                      };	
	return false;
 	}

