jQuery.preloadImages = function()
					{
						for(var i = 0; i<arguments.length; i++)
						{
							jQuery("<img>").attr("src", arguments[i]);
						}
					};

$(document).ready(function(){
	jQuery.easing.def = "easeOutCubic";
	
	$("#descargas a").hover(function() {
	  $(this).next("em").animate({opacity: "show", top: "-70"}, 800);
	}, function() {
	  $(this).next("em").animate({opacity: "hide", top: "-90"}, 1200);
	});
	
		$("#u2zone a").hover(function() {
	  $(this).next("em").animate({opacity: "show", top: "-70"}, 800);
	}, function() {
	  $(this).next("em").animate({opacity: "hide", top: "-90"}, 1200);
	});
		
			$("#contact a").hover(function() {
	  $(this).next("em").animate({opacity: "show", top: "-70"}, 800);
	}, function() {
	  $(this).next("em").animate({opacity: "hide", top: "-90"}, 1200);
	});

	

		$("a.show1").click(function() {
				$(this).addClass("activetab");
				$("a.show3, a.show2, a.show4, a.show5, a.show6, a.show7, a.show8, a.show9, a.show10, a.show11, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "0px"
                }, 900);
				$("#navindicator").fadeOut("slow");
				return false;
        });
        $("a.show2").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show3, a.show4, a.show5,  a.show6, a.show7, a.show8, a.show9, a.show10, a.show11, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-880px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
        $("a.show3").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show2, a.show4, a.show5,  a.show6, a.show7, a.show8, a.show9, a.show10, a.show11, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-1760px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
		 $("a.show4").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show2, a.show3, a.show5,  a.show6, a.show7, a.show8, a.show9, a.show10, a.show11, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-2640px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
		 
		  $("a.show5").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show2, a.show3, a.show4,  a.show6, a.show7, a.show8, a.show9, a.show10, a.show11, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-3520px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
		  
		    $("a.show6").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show2, a.show3, a.show4,  a.show5, a.show7, a.show8, a.show9, a.show10, a.show11, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-4400px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
			
			  $("a.show7").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show2, a.show3, a.show4,  a.show5, a.show6, a.show8, a.show9, a.show10, a.show11, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-5280px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
			  
			   $("a.show8").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show2, a.show3, a.show4,  a.show5, a.show6, a.show7, a.show9, a.show10, a.show11, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-6160px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
			   
			   	$("a.show9").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show2, a.show3, a.show4,  a.show5, a.show6,  a.show7, a.show8, a.show10, a.show11, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-7040px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
				
		        $("a.show10").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show2, a.show3, a.show4,  a.show5, a.show6,  a.show7, a.show8, a.show9, a.show11, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-7920px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
				
			    $("a.show11").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show2, a.show3, a.show4,  a.show5, a.show6,  a.show7, a.show8, a.show9, a.show10, a.show12").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-8800px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
				
				$("a.show12").click(function() {
				$(this).addClass("activetab");
				$("a.show1, a.show2, a.show3, a.show4,  a.show5, a.show6,  a.show7, a.show8, a.show9, a.show10, a.show11").removeClass("activetab");
                $(".wide").animate({
                        marginLeft: "-9680px"
                }, 1100);
				$("#navindicator").fadeOut("slow");
				return false;
        });
			  
		 
		 
		 
		
		$(function() {
	// Use this example, or...
	$('a[@rel*=identity1]').lightBox();
	$('a[@rel*=identity2]').lightBox();
	$('a[@rel*=identity3]').lightBox();
	$('a[@rel*=identity4]').lightBox();
	$('a[@rel*=identity5]').lightBox();
	$('a[@rel*=editorial1]').lightBox();
	$('a[@rel*=editorial2]').lightBox();
	$('a[@rel*=editorial3]').lightBox();
	$('a[@rel*=works1]').lightBox();
	$('a[@rel*=works2]').lightBox();
	$('a[@rel*=works3]').lightBox();
	$('a[@rel*=works4]').lightBox();
	$('a[@rel*=works5]').lightBox();
	$('a[@rel*=works6]').lightBox();
	$('a[@rel*=works7]').lightBox();
	$('a[@rel*=works8]').lightBox();
	$('a[@rel*=works9]').lightBox();
	$('a[@rel*=works010]').lightBox();
	$('a[@rel*=creativity1]').lightBox();
	$('a[@rel*=creativity2]').lightBox();
	$('a[@rel*=creativity3]').lightBox();
	$('a[@rel*=creativity4]').lightBox();
	$('a[@rel*=creativity5]').lightBox();
	$('a[@rel*=creativity6]').lightBox();
	$('a[@rel*=creativity7]').lightBox();
	$('a[@rel*=creativity8]').lightBox();
	$('a[@rel*=creativity9]').lightBox();
	$('a[@rel*=photo1]').lightBox();
	$('a[@rel*=photo2]').lightBox();
	$('a[@rel*=photo3]').lightBox();

	// Select all links that contains lightbox in the attribute rel
	// This, or...
/*	/$('div.currentimage a').lightBox(); // Select all links in object with gallery ID
	// This, or...
	$('a.lightbox').lightBox(); // Select all links with lightbox class
	// This, or...
	$('a').lightBox(); // Select all links in the page
	// ... The possibility are many. Use your creative or choose one in the examples above */
	});
		
	$("button").click(function(){					   				   
		$(".error").hide();
		var hasError = false;
		var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
		
		var emailVal = $("#email").val();
		if(emailVal == '') {
			$("#email").after('<span class="error">(Enter the email address)</span>');
			hasError = true;
		} else if(!emailReg.test(emailVal)) {	
			$("#email").after('<span class="error">(Please enter a valid email address)</span>');
			hasError = true;
		}
		
		var nameVal = $("#name").val();
		if(nameVal == '') {
			$("#name").after('<span class="error">(You forgot to enter the name)</span>');
			hasError = true;
		}
		
		var messageVal = $("#message").val();
		if(messageVal == '') {
			$("#message").after('<span class="error">(You forgot to enter the message)</span>');
			hasError = true;
		}
		
		var subjectVal = $("#subject").val();
		if(messageVal == '') {
			$("#subject").after('<span class="error">(You forgot to enter the Subject)</span>');
			hasError = true;
		}
		
		var subjectVal = $("#subject").val();
		var weburlVal = $("#weburl").val();
		var webdescVal = $("#webdesc").val();
		var emailToVal = "jwhanif@gmail.com";
		
		if(hasError == false) {
			$(this).hide();
			$("button").append('<img src="assets/images/loading.gif" alt="submiting" id="submitingform" />');
			$.post("http://localhost/jwhanif/ajaxsubmit.php",
			{ emailTo: emailToVal, emailFrom: email, Name: nameVal,  subject: subjectVal, Website: weburl, WebDesc: webdescVal, message: messageVal },
   					function(data){
						$("#submitingform").hide("normal", function() {				   
							$(".wide").animate({
							marginLeft: "-880px"
							}, 800);
						});
   					}
				 );
		}
		
		return false;
	});						   
			$(window).load(function () {
					$("#sidetabs").animate({opacity: "show", left: "1"}, 1000);
					$("#navindicator").animate({opacity: "show", left: "5"}, 1000);
					/*$.preloadImages(
									"/sites/all/themes/geeksandgod/images/menuitems/episodesover.gif",
									"/sites/all/themes/geeksandgod/images/menuitems/feedsover.gif",
									"/sites/all/themes/geeksandgod/images/menuitems/forumsover.gif",
									"/sites/all/themes/geeksandgod/images/menuitems/hostsover.gif",
									"/sites/all/themes/geeksandgod/images/menuitems/contactover.gif"
									);*/
			});
			
			
			
});

