function centerContent(){
		
		var newLeft=($(document).width()-$('#content').width())/2;
		var newTop=($(document).height()-$('#content').height())/2;		
	
		$('#content').css({'left':newLeft,'top':newTop});
	}
	
	var isTabTop=false;
	var isTabHome=true;
	function loadTab()
	{
		$('#tab').load('tabcontent.html',function(){
			
			
					
		
					$(this).fadeIn(1000,function(){ 
						
							$('#bg img').parent().fadeIn(1500,function(){ /*$('#content').load('home.html'); $('#content').fadeIn(500);*/ });
						
					 });
					
					$('#tabArrow a').click(function(){
						
						
						if(tabIsOpen)
						{
							$('#tabContent ul').fadeOut(200,function(){
								
								$('#tabContent').animate({'width':'0px'},1000,function(){ 
																			
																			$('#tabArrow a').children('img').attr('src','images/arrow.png');
																			
																			if(!isTabTop && !isTabHome)
																			{
																				
																				$('#tab').animate({'top':'30px'},1000);
																			}
																			else
																			{
																				$('#tab').animate({'top':'45%'},1000);
																			}
																			
																			 });
							
								});  
							
							tabIsOpen=false;
						
						}
						
						else
						{
							$('#tabContent').animate({'width':'590px'},1000,function(){ 
																			
																			$('#tabArrow a').children('img').attr('src','images/arrow_left.png');
																			$('#tabContent ul').fadeIn(200);  
																			
																			
																			
																			if(!isTabTop && !isTabHome)
																			{
																				
																				$('#tab').animate({'top':'30px'},1000);
																			}
																			else
																			{
																				$('#tab').animate({'top':'45%'},1000);
																			}
																			});
							tabIsOpen=true;
						}
						
					});
					
					
	
					BindMainLinks();
				});
			
			
	}
		
	function resizeBg()
	{
		
		$('.bg img').attr('width',$(window).width());
		$('.bg').css('height',$(window).height());
	
	}
	
	
	function BindMainLinks()
	{
		$('#lnkHome,#logo').click(function(){
				
				$('body').css('overflow','hidden');
				hideClientContent();
				$('#content').fadeOut(500);
				$('#galleryDiv').fadeOut(500);
				//$('#content').load('home.html');
				
				if($('#bg img')[0].complete)
				{

					$(currentBg).fadeOut(1000);
					$('#bg').fadeIn(1000,function(){ $('body').css('overflow','auto'); });	
					currentBg=$('#bg');		
		
				}
				else
				{				
					$('#bg img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bg').fadeIn(1000,function(){ $('body').css('overflow','auto');});
							
							currentBg=$('#bg');

					});
				}
				
				isTabHome=true;
				$('#tabArrow a').click();
				
			
				
			});
			
		$('#lnkAboutUs').click(function(){
					
				
					
				$('body').css('overflow','hidden');
				hideClientContent();
				$('#content').fadeOut(500);
				$('#galleryDiv').fadeOut(500);
				$('#content').load('about.html');
							
				if($('#bgAbout img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgAbout').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#content').fadeIn(500);});	
					currentBg=$('#bgAbout');	
					
				}
				else
				{				
					$('#bgAbout img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgAbout').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#content').fadeIn(500);});
							
							currentBg=$('#bgAbout');

					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
					
			});
			
			
		$('#lnkProducts').click(function(){
			
			$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('products.html');
			
			if($('#bgProjects img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProjects').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProjects');	
					
				}
				else
				{				
					$('#bgProjects img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProjects').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProjects');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
			});
			
			
			
		$('#lnkSofa').click(function(){
			
			
			$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('SofaFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
			
			
				
			});
			
		$('#lnkCafeTable').click(function(){
			
			
				$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('CafeTableFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
			
			
				
			});
			
			$('#lnkConferenceTable').click(function(){
				
				$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('ConferenceTableFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
				
			
				
			});
			
			$('#lnkCentersideTable').click(function(){
				
			
				$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('CentersideTableFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
			
			
				
			});
			
			
			
			$('#lnkTrainingTable').click(function(){
				
				
				$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('TrainingTableFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
			
			
				
			});
			
			$('#lnkWorkTable').click(function(){
				
				
			$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('WorkTableFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
			
				
			});
			
			
			$('#lnkCafechairs').click(function(){
				
				
				$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('CafeChairsFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
			
			
				
			});
			
			$('#lnkDinningchairs').click(function(){
				
				
				$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('DinningChairsFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
			
				
			});
			
			$('#lnkBarStools').click(function(){
				
				
			$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('BarStoolsFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
				
			
				
			});
			
			$('#lnkAuditoriumchairs').click(function(){
				
				
			$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('AuditoriumFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
				
				
			
				
			});
			
			$('#lnkBeds').click(function(){
				
			$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('BedsFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
		
				
			});
			
			$('#lnkBenches').click(function(){
				
				
			$('body').css('overflow','hidden');
			hideClientContent();
			$('#content').fadeOut(500);
			$('#galleryDiv').load('BenchesFrame.html');
			
			if($('#bgProducts img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});	
					currentBg=$('#bgProducts');	
					
				}
				else
				{				
					$('#bgProducts img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgProducts').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#galleryDiv').fadeIn(500);});
							
							currentBg=$('#bgProducts');
		
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
				
			
				
			});
			

		$('#lnkClients').click(function(){
						
			
				$('body').css('overflow','hidden');
				$('#content').fadeOut(500);
				$('#galleryDiv').fadeOut(500);
			
				
				if($('#bgClients img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgClients').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#clientStrip').fadeIn(500,function(){
						
						  	$('#clientStrip').load('clientsFrame.html');
						
						});});	
					currentBg=$('#bgClients');		
										
				}
				else
				{				
					$('#bgClients img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgClients').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#clientStrip').fadeIn(500);});
							
							currentBg=$('#bgClients');
							
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
			});		
			
		$('#lnkContactUs').click(function(){
			
				$('body').css('overflow','hidden');
				hideClientContent();
				$('#content').fadeOut(500);
				$('#galleryDiv').fadeOut(500);
				$('#content').load('contact.html');
				
				if($('#bgaboutus img')[0].complete)
				{
					$(currentBg).fadeOut(1000);
					$('#bgaboutus').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#content').fadeIn(500);});	
					currentBg=$('#bgaboutus');		
					
					
				}
				else
				{				
					$('#bgaboutus img').load(function(){
							
							$(currentBg).fadeOut(1000);
							
							$('#bgaboutus').fadeIn(1000,function(){ $('body').css('overflow','auto'); $('#content').fadeIn(500);});
							
							currentBg=$('#bgaboutus');
							
							
							
					});
				}
				
				isTabHome=false;
				$('#tabArrow a').click();
				
			});				
			
							
	}

var leftPx=0;
var scrollInt=0;
function clientsNavigation()
{

	$('#next').hover(function(){
						
												
					scrollInt= setInterval(scrollLeft,15);
					 
					},
					function(){
						
							clearInterval(scrollInt);					
					});
	
	$('#prev').hover(function(){
						
												
					scrollInt= setInterval(scrollRight,15);
					 
					},
					function(){
						
							clearInterval(scrollInt);					
					});
}

function scrollLeft()
{
	leftPx-=5;
	
	
	
	$('#clientList').css('left',leftPx+'px'); 
	  
}

function scrollRight()
{
	leftPx+=5;
	
	 $('#clientList').css('left',leftPx+'px'); 
}




function DisplayMenu()
{
	
	 $('#MenuList').css('visibility', 'visible');

}

function DisplayTables()
{
	CloseSubMenu();
	 $('#TableList').css('top',25);
	 $('#TableList').css('visibility', 'visible');
}

function DisplayChairs()
{
	CloseSubMenu();
	 $('#ChairList').css('top',25);
	$('#ChairList').css('visibility', 'visible');
}


function CloseSubMenu()
{
	$('#TableList').css('visibility', 'hidden');
	$('#ChairList').css('visibility', 'hidden');
}


function CloseMenu()
{
	$('#TableList').css('visibility', 'hidden');
	$('#ChairList').css('visibility', 'hidden');
	$('#MenuList').css('visibility', 'hidden');
}


function hideClientContent()
{
	$('#clientStrip').fadeOut(1000);
	$('#content').fadeOut(1000);
	
}
