// scripts on portfolio page

var lastCat=0;
			var lastPage='';
			function showClicks(id,cat,lastL,page)
			{
			
			if (cat!=0)
					{
						
					
					
					
						var nav;
						
						if (lastCat!=cat){nav = '<strong>You have viewed:</strong> ';
						
						
						
						}
						else{
						
						
						
										nav = window.document.getElementById("navigation").innerHTML + ' &gt; ';
							}
							
							
							//if not alreasy there
						if (lastPage.indexOf("*"+page+"*")==-1)
						{
										
										nav = nav + '<a href="javascript:simClick(\''+lastL+'\','+cat+',\'\',0)">Page '+page+'</a>';
										
										
										
										//output
										window.document.getElementById("navigation").innerHTML = nav;
						
						}
						lastCat = cat;
						
								
						
						
						
					
					}//end of show past pages
			lastPage=lastPage + '*'+page+'*,';
			
			/*
			//add a back button 
			var thisB = id.substring(4,id.length);
			thisB = 'back' + thisB;
			
			window.document.getElementById(thisB).innerHTML = 'BACK';
			
			*/
			}
			
			
			function clearNav(cat)
			{
			
				if (lastCat!=cat){
				window.document.getElementById("navigation").innerHTML = '';
				lastCat=0;
				lastPage='';
				}
			
			}
			
			
			
			
			
			function simClick(id,cat,lastL,action,page)
			{
			
			$('#'+id).click(); 
			
			if (action!=0){showClicks(id,cat,lastL,page)}
			
			}
			
			
			function simClick2(id)
			{
			
			alert(id);
			$('#link-nav-4').click();
			
			
			
			}
			
			
			
			
			
			$(function(){ 
   
$(".port-indivi").hover(function(){ 
        
$("img", this).stop().animate({top:"-200px"},{queue:false,duration:200}); 
    
}, function() { 
       
$("img", this).stop().animate({top:"0px"},{queue:false,duration:200}); 
    
}); 
});


		
		function greyPage()
		{
			//create the layer and show it
			$("#grey_layer").animate({
				opacity: 0.25,
				width: '100%',
				height: $(document).height()   
 			 });
			
			}
		
		
		
		
		function viewDetail(id)
		{
				
				greyPage();
				
				
				
				  $("#full_port").fadeIn("slow");
				  
				  window.document.getElementById("full_port").innerHTML = '<img src="http://www.flowebdesign.ie/library/ajax-loader2.gif" alt="Please wait" width="16" height="16" />&nbsp;&nbsp;&nbsp; Please wait while the detail is loading';
				 
				  //then call the detail
				  //call ajax when the function is called
				$.ajax({
				
						type: "GET",
						url: "port-detail-ajax.asp",
						data: {id: id},
						success: function(dataBack){
												
												window.document.getElementById("full_port").innerHTML = '<div style="margin-left: 920px;"><a href="javascript:closeP()"><img src="http://www.flowebdesign.ie/library/closewin.png" width="18" height="18" alt="Close the window" border="0" /></a></div>' + dataBack + '<br /><a href="javascript:closeP()"><img src="http://www.flowebdesign.ie/library/closewin.png" width="18" height="18" alt="Close the window" border="0" /></a>';
												//alert(dataBack)
											}
				
				
				
				
				});
				  
				  
			

		
		
		
		
		}//end function viewDetail

			
			
			
			function closeP()
			{
			
			  $("#full_port").fadeOut("slow");
			  $("#grey_layer").hide();
			 
			
			}
			
			
			
			
			
