/**
 * @author Jeff common calls for jQuery $document ready
 *
 * Developed by topdown Webmasters United.org / Valid Webs.com
 *
 * Images and code with-in these custom files are (c) copy right protected and are NOT GLP
 *  (c) Webmasters United.org / Valid Webs.com Web Development, 2009 
 *
 * If you are considering pirating this theme, there is nothing I can do to stop you at this point.
 * However, I ask that you please consider that I am just a person trying to make some money 
 * doing what I love, designing themes. I am very flattered that my theme is popular enough to pirate,
 * but I would greatly appreciate it if you would not re-distribute my theme.
 * Thank You,
 *    topdown Webmasters United.org / Valid Webs.com
 *
*/

$(document).ready(function(){
	//new window method for external links
	$('a.external').click(function(){
		window.open(this.href);
		
		return false;
	});
	$('a.twitter').click(function(){
		window.open(this.href);
		
		return false;
	});
	

	 $.preloadCssImages({statusTextEl: '#textStatus', statusBarEl: '#status'});

	
	var loading = '<div style="float:left;position: relative;"><div style="position: absolute; top: 50px; left: 40px;"><img src="images/loading.gif" /></div></div>';
	
   	//Load the default page	
	// animated GIF image
 	$("#scontent").empty().html(loading);
	$("#scontent").load("services/1.html", function () {
			//$("#scontent").fadeIn(1000);
			$('.viewport').carousel('.simplePrevious', '.simpleNext');
			$("a.image").fancybox({ 
				'zoomSpeedIn': 300, 
				'zoomSpeedOut': 300,
				'overlayShow': true,
				'overlayOpacity': 0.5,
				'overlayColor': '#000'
			});
			$('a.external').click(function(){
				window.open(this.href);
				
				return false;
			});
		});

	$("#page1").click(function(){
		$("#first").addClass("sel-service");
		$("#second").removeClass("sel-service");
		$("#third").removeClass("sel-service");
		$("#forth").removeClass("sel-service");
		$("#fifth").removeClass("sel-service");
		$("#sixth").removeClass("sel-service");		
		// animated GIF image
 		$("#scontent").empty().html(loading);
		$("#scontent").load("services/1.html", function () {
			
			$('.viewport').carousel('.simplePrevious', '.simpleNext');
			$("a.image").fancybox({ 
				'zoomSpeedIn': 300, 
				'zoomSpeedOut': 300, 
				'overlayShow': true,
				'overlayOpacity': 0.5,
				'overlayColor': '#000'
			});
			
			$('a.external').click(function(){
				window.open(this.href);
				
				return false;
			});
		});
	});
	$("#page2").click(function(){
		$("#second").addClass("sel-service");
		$("#first").removeClass("sel-service");
		$("#third").removeClass("sel-service");
		$("#forth").removeClass("sel-service");
		$("#fifth").removeClass("sel-service");
		$("#sixth").removeClass("sel-service");
		// animated GIF image
 		$("#scontent").empty().html(loading);
		$("#scontent").load("services/2.html", function () {
			
			$('.viewport').carousel('.simplePrevious', '.simpleNext');
			$("a.image").fancybox({ 
				'zoomSpeedIn': 300, 
				'zoomSpeedOut': 300, 
				'overlayShow': true,
				'overlayOpacity': 0.5,
				'overlayColor': '#000'
			});
			$('a.external').click(function(){
				window.open(this.href);
				
				return false;
			});
		});
	});
	$("#page3").click(function(){
		$("#third").addClass("sel-service");
		$("#second").removeClass("sel-service");
		$("#first").removeClass("sel-service");
		$("#forth").removeClass("sel-service");
		$("#fifth").removeClass("sel-service");
		$("#sixth").removeClass("sel-service");
		// animated GIF image
 		$("#scontent").empty().html(loading);
		$("#scontent").load("services/3.html", function () {
			
			$('.viewport').carousel('.simplePrevious', '.simpleNext');
			$("a.image").fancybox({ 
				'zoomSpeedIn': 300, 
				'zoomSpeedOut': 300, 
				'overlayShow': true,
				'overlayOpacity': 0.5,
				'overlayColor': '#000'
			});
			
			$('a.external').click(function(){
				window.open(this.href);
				
				return false;
			});
		});
	});
	$("#page4").click(function(){
		$("#forth").addClass("sel-service");
		$("#second").removeClass("sel-service");
		$("#third").removeClass("sel-service");
		$("#first").removeClass("sel-service");
		$("#fifth").removeClass("sel-service");
		$("#sixth").removeClass("sel-service");
		// animated GIF image
 		$("#scontent").empty().html(loading);
		$("#scontent").load("services/4.html", function () {
			$('.viewport').carousel('.simplePrevious', '.simpleNext');
			$("a.image").fancybox({ 
				'zoomSpeedIn': 300, 
				'zoomSpeedOut': 300, 
				'overlayShow': true,
				'overlayOpacity': 0.5,
				'overlayColor': '#000'
			});

			$('a.external').click(function(){
				window.open(this.href);
				
				return false;
			});
		});
	});
	$("#page5").click(function(){
		$("#fifth").addClass("sel-service");
		$("#second").removeClass("sel-service");
		$("#third").removeClass("sel-service");
		$("#forth").removeClass("sel-service");
		$("#first").removeClass("sel-service");
		$("#sixth").removeClass("sel-service");
		// animated GIF image
 		$("#scontent").empty().html(loading);
		$("#scontent").load("services/5.html", function () {
			
		});
	});
	$("#page6").click(function(){
		$("#sixth").addClass("sel-service");
		$("#second").removeClass("sel-service");
		$("#third").removeClass("sel-service");
		$("#forth").removeClass("sel-service");
		$("#fifth").removeClass("sel-service");
		$("#first").removeClass("sel-service");
		// animated GIF image
 		$("#scontent").empty().html(loading);
		$("#scontent").load("services/6.html", function () {
			$('.viewport').carousel('.simplePrevious', '.simpleNext');
			$("a.image").fancybox({ 
				'zoomSpeedIn': 300, 
				'zoomSpeedOut': 300, 
				'overlayShow': true,
				'overlayOpacity': 0.5,
				'overlayColor': '#000'
			});

			$('a.external').click(function(){
				window.open(this.href);
				
				return false;
			});
		});
	});
	
	/* This is basic - uses default settings */ 
	$("a.image").fancybox(); 
	/* Using custom settings */ 
	$("a#inline").fancybox({ 'hideOnContentClick': true }); 
	$("a.group").fancybox({ 
		'zoomSpeedIn': 300, 
		'zoomSpeedOut': 300, 
		'overlayShow': true,
		'overlayOpacity': 0.5,
		'overlayColor': '#000'
	});

});

