			var aspectRatio;
			
			$(document).ready(
				function(){
					
					setDims();
					getDims();
					$(window).resize(function(){
						getDims();
					});
					startLightbox();
					startNews();
					var dd=new String(document.location);
					if(dd.indexOf('find_us')!=-1){
						setTimeout('loadMap()',1000);
					}
					
					
			});
			
			function startLightbox(){
				$('#gallery a').lightBox(); 
			}
			
			
			
			function loadMap(){
				$('#map').load('../sections/_gmap.php');
			}
			
			var imgWidth=0;
			var imgHeight=0;
			
			function setDims(){
				imgWidth=1024;
				imgHeight=685;
				aspectRatio=imgWidth/imgHeight;
			}
			
			
			
			function getDims(){
					bgwidth=$(window).width();
					bgheight=$(window).height();
					w1=imgWidth;
					h1=imgHeight;
					if(bgwidth>imgWidth){
						w1=bgwidth;
						h1=w1/aspectRatio;
					}
					if(h1<bgheight){
						h1=bgheight;
						w1=h1*aspectRatio;
					}
					opText=$(window).width()+'x'+$(window).height();
					$('#fullbg').css({width:w1,height:h1});
					
			}
			
			var newsNow=0;
			var newsMax=0;
			var newsObj;
			var newstime=5000;
			
			
			function startNews(){
				newsObj=$('li');
				newsMax=newsObj.length;
				newsItem();
			}
			
			function newsItem(){
				$('li:visible').hide();
				newsObj.eq(newsNow).show();
				newsNow++;
				if(newsNow>=newsMax){newsNow=0;}
				setTimeout('newsItem()',newstime);
			}
			
			function ajaxForm(){
				$('#contactajax').prepend('<div class="loading">Sending...</div>');
				var comlist = new Object();
				comlist['name']=$('#name').val();
				comlist['email']=$('#email').val();
				comlist['mobile']=$('#mobile').val();
				comlist['comment']=$('#comment').val();
				$('#contactajax').load('../sections/ajaxform.php',comlist);
				
			}
