
function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1500, function() {
            $active.removeClass('active last-active');
        });
}

// JQUERY
$(function(){
	setInterval( "slideSwitch()", 7000 );
//	theHeader(0);
	theGoogMap();
	$("#googmap").show();
});


var theGoogMap = function(){	
	var map = new GMap2(document.getElementById('cmap'));	
	var mapControl = new GHierarchicalMapTypeControl();
	mapControl.clearRelationships();
	mapControl.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", false);
	map.addMapType(G_PHYSICAL_MAP);
	map.addControl(mapControl);
	map.addControl(new GSmallMapControl());
//	map.addControl(new GMapTypeControl());
//	var speromap = new GLatLng(37.097963,-113.575722);
	var speromap = new GLatLng(lat,long);
	map.setCenter(speromap, 8);	
	marker = new GMarker(speromap); 
	map.addOverlay(marker);
};


if (document.images) {            

  // In Images

             		 	 img1on = new Image();      
            img1on.src = "images/home_on.jpg";
           		 	     img2on = new Image();      
            img2on.src = "images/faq_on.jpg";
             		 	 img3on = new Image();      
            img3on.src = "images/info_on.jpg";
           		 	     img4on = new Image();      
            img4on.src = "images/us_on.jpg";
           		 	     img5on = new Image();      
            img5on.src = "images/contact_on.jpg";

  // Out Images
           		 	     img1off = new Image();      
            img1off.src = "images/home_off.jpg";
                       	 img2off = new Image();      
            img2off.src = "images/faq_off.jpg";
           		 	     img3off = new Image();      
            img3off.src = "images/info_off.jpg";
                       	 img4off = new Image();      
            img4off.src = "images/us_off.jpg";
           		 	     img5off = new Image();      
            img5off.src = "images/contact_off.jpg";
}

// Function to 'activate' images.
function imgOn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "on.src");
        }
}

// Function to 'deactivate' images.

function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "off.src");
        }
}




function checkform()
{
	if (document.feedback.name.value == '')
	{
		alert('Your name is required');
		return false;
	}
	else if (document.feedback.address.value == '')
	{
		alert('Your Address is required');
		return false;
	}
	else if (document.feedback.city.value == '')
	{
		alert('Your City is required');
		return false;
	}
	else if (document.feedback.zip.value == '')
	{
		alert('Your Zipcode is required');
		return false;
	}
	else if (document.feedback.areacode.value == '')
	{
		alert('Your Phone is required');
		return false;
	}
	else if (document.feedback.prefix.value == '')
	{
		alert('Your Phone is required');
		return false;
	}
	else if (document.feedback.number.value == '')
	{
		alert('Your Phone is required');
		return false;
	}
	else if (document.feedback.email.value == '')
	{
		alert('Your email is required');
		return false;
	}	
	else if (document.feedback.captcha.value == '')
	{
		alert('Type the characters you see in the image');
		return false;
	}
	else if (document.feedback.captcha.value != 'spero')
	{
		alert('Type the characters you see in the image');
		return false;
	}
	return true;
}
