
//preloader
jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}
$.preloadImages("images/home_roll.jpg", "images/news_roll.jpg", "images/services_roll.jpg", "images/demos_roll.jpg", "images/contact_roll.jpg", "images/about_roll.jpg", "images/humveevid_roll.jpg");



//rollovers
$(
	function()
	{
		// set up rollover
		$("img.rollover").hover(
			function()
			{
				this.src = this.src.replace("_off","_roll");
			},
			function()
			{
				this.src = this.src.replace("_roll","_off");
			}
		);
	}
)

//google map

function initialize() {
        if (GBrowserIsCompatible()) {  
        var map = new GMap2(document.getElementById("map_canvas"));   
        map.setUIToDefault(); 
		map.addMapType(G_SATELLITE_3D_MAP);	
		map.removeMapType(G_HYBRID_MAP);	
		map.removeMapType(G_PHYSICAL_MAP);
		map.removeMapType(G_SATELLITE_MAP);
        var point = new GLatLng(32.284375, -90.241975);    
        map.setCenter(point,13);      
        map.addOverlay(new GMarker(point));  
      }
    }


//index page rollovers

$(document).ready(function() {

	//move the x axis image in pixel
	var movex = 0;
	
	//move the y axis image in pixel
	var movey = 0;
	
	//zoom x percentage, 1.2 =120%
	var zoomx = 5;

    //zoom y percentage, 1.2 =120%
	var zoomy = 4.3;

	//On mouse over those thumbnail
	$('.item').hover(function() {
		
		//Set the width and height according to the zoom percentage
		var width = $('.item').width() * zoomx;
		var height = $('.item').height() * zoomy;
		
		//Move and zoom the image
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':movey, 'left':movex}, {duration:200});
		
		//Display the caption
		$(this).find('div.caption').stop(false,true).fadeIn(800);
		
		
	},
	function() {
   		
		//Reset the image
		$(this).find('img').stop(false,true).animate({'width':$('.item').width(), 'height':$('.item').height(), 'top':'0', 'left':'0'}, {duration:300});	
		
		//Hide the caption
		$(this).find('div.caption').stop(false,true).fadeOut(100);

	});

});
