$(document).ready(function() {
	$("body").prepend('<div id="console"></div>');

		$('#navDiv').hide();
		$("#contentDiv").hide();	    
   		$("#patternDiv").show();
		$('#homestripBar').hide();
		$('#sidebarHomepage').hide();

		//Umbrella();
	//	UmbrellaStick();
		loadingHomePage('/home.aspx');

		var timer;
		function Umbrella(event){
     			$(".object3").css("top","-100px");
    			$(".object3").animate({"top":70},500, "easeOutBack", null);
     			$(".object2").css("top","-200px");
    			$(".object2").animate({"top":220},500, "linear", null);
		}




		function UmbrellaStick(event){
     			$(".object2").css("top","-184px");
    			$(".object2").animate({"top":200},407, "easeOutBack", Ball);
		}

		function Ball(event){
     			$(".object1").css("height","150px");
     			$(".object1").css("width","150px");
     			$(".object1").css("left","-150px");
    			$(".object1").animate({"height":160,"width":160,"left":700},1100, "easeOutBack", Chair);
		}

		function Chair(event){
     			$(".object4").css("left","1200px");
   			$(".object4").animate({"left":750},1228, "easeOutBack", QuotationMark);
		}

		function QuotationMark(event){
     			$(".openQuotes").css("top","0");
     			$(".openQuotes").css("width","0");
     			$(".openQuotes").css("height","0");
     			$(".openQuotes").css("opacity","0");
    			$(".openQuotes").animate({"top":160,"width":186,"height":186,"opacity":1},700, "easeOutBack", FirstText);
		}

		function ClosedQuotation(event){	
			$(".closeQuotes").css("left","494");
			$(".closeQuotes").css("top","0");
    			$(".closeQuotes").css("opacity","0");
    			$(".closeQuotes").animate({"left":494, "top":255,"opacity":1},1000, "linear", loadingHomePage('/home.aspx'));
		}

		function FirstText(event){	
			$(".textAnimation1").css("top","0"); 
			$(".textAnimation1").css("left","308");
    			$(".textAnimation1").css("opacity","0");
    			$(".textAnimation1").animate({"top":195, "left":308,"opacity":1},1000, "easeOutBack", SecondText);
		}


		function SecondText(event){
			$(".textAnimation2").css("left","302");
			$(".textAnimation2").css("top","300");
    			$(".textAnimation2").css("opacity","0");
    			$(".textAnimation2").animate({"top":232, "left":308, "opacity":1},600, "easeOutBack", ThirdText);
		}

		function ThirdText(event){	
			$(".textAnimation3").css("left","567");
			$(".textAnimation3").css("top","400");
     			$(".textAnimation3").css("opacity","0");
    			$(".textAnimation3").animate({"top":232, "opacity":1},500, "linear", FouthText);
		}

		function FouthText(event){	
			$(".textAnimation4").css("left","0");
     			$(".textAnimation4").css("opacity","0");
    			$(".textAnimation4").animate({"left":308, "top":267,"opacity":1},400, "linear", ClosedQuotation);
		}



function loadingHomePage(param){

		$('#contentDiv').load(param, function(){
			$("#animation1").hide().delay("100").fadeOut('slow', function(){

			$("#navDiv").show().delay("100").fadeIn('slow');
			$("#navDiv").css("left","50");
			$("#navDiv").css("top","-45");
    			$("#navDiv").css("opacity","0");
    			$("#navDiv").animate({"left":50, "top":0,"opacity":1},1000, "easeOutBack",null);
		

			$("#homestripBar").show().delay("500").fadeIn('slow');
			$("#homestripBar").animate({"height":420,"opacity":.2},1000, "easeOutBack",null);
			$("#sidebarHomepage").show().delay("500").fadeIn('slow');
			$("#sidebarHomepage").animate({"height":400,"opacity":1},1000, "easeOutBack", homeIn());
			
	

			});
		});
	}
});
//
//
//


function homeIn(){

	$('.thumbStrip').animate({"opacity":'100'},600, "easeOutBack");
	$('.contactStrip').animate({"opacity":'0'},600, "easeOutBack");
	$('.aboutStrip').animate({"opacity":'0'},600, "easeOutBack",function(){	$('#contentDiv').fadeIn();});
	setTimeout(function() {$('#welcomeWrapper').delay('100').fadeIn('slow')}, 1000);

}

function  loadingpageHome( param) {

	$('#contentDiv').fadeOut();
    	$('#homestripBar').animate({"height":'420px','top':'50%', 'marginTop':'-210px'},600, "easeOutBack");
    	$('#sidebarHomepage').animate({"height":'400px','top':'50%', 'marginTop':'-200px'},600, "easeOutBack", function(){
    	$('.thumbStrip').animate({"opacity":'100'},600, "easeOutBack");
	$('.blackStrip').animate({"opacity":'0'},600, "easeOutBack");
	$('.contactStrip').animate({"opacity":'0'},600, "easeOutBack");
	$('.aboutStrip').animate({"opacity":'0'},600, "easeOutBack");


		if($("#loader").css("display") != "none"){
			$('#loader').fadeOut("slow", insertdata( param));
			return;
		}

		$('#contentDiv').hide();
		$('#loader').fadeIn("slow").delay("700").fadeOut("slow", insertdata( param));

});
	}


function  loadingpagePortfolio( param) {
$('#contentDiv').fadeOut();

    	$('#homestripBar').animate({"height":'15px','top':'100%', 'marginTop':'-15px'},600, "easeOutBack");
    	$('#sidebarHomepage').animate({"height":'6px', 'top':'100%', 'marginTop':'-6px'},600, "easeOutBack", function(){
	$('.blackStrip').animate({"opacity":'100'},600, "easeOutBack");
    	$('.thumbStrip').animate({"opacity":'0'},600, "easeOutBack");
	$('.contactStrip').animate({"opacity":'0'},600, "easeOutBack");
	$('.aboutStrip').animate({"opacity":'0'},600, "easeOutBack");


		if($("#loader").css("display") != "none"){
			$('#loader').fadeOut("slow", insertdata( param));
			return;
		}

		$('#contentDiv').hide();
		$('#loader').fadeIn("slow").delay("700").fadeOut("slow", insertdata( param));

});
	}



function  loadingpageAbout( param) {

$('#contentDiv').fadeOut();
    	$('#homestripBar').animate({"height":'420px','top':'50%', 'marginTop':'-210px'},600, "easeOutBack");
    	$('#sidebarHomepage').animate({"height":'400px','top':'50%', 'marginTop':'-200px'},600, "easeOutBack", function(){
    	$('.thumbStrip').animate({"opacity":'0'},600, "easeOutBack");
	$('.blackStrip').animate({"opacity":'0'},600, "easeOutBack");
	$('.contactStrip').animate({"opacity":'0'},600, "easeOutBack");
	$('.aboutStrip').animate({"opacity":'100'},600, "easeOutBack");


		if($("#loader").css("display") != "none"){
			$('#loader').fadeOut("slow", insertdata( param));
			return;
		}

		$('#contentDiv').hide();
		$('#loader').fadeIn("slow").delay("700").fadeOut("slow", insertdata( param));

});
	}



function  loadingpageContact( param) {

	$('#contentDiv').fadeOut();
    	$('#homestripBar').animate({"height":'420px','top':'50%', 'marginTop':'-210px'},600, "easeOutBack");
    	$('#sidebarHomepage').animate({"height":'400px','top':'50%', 'marginTop':'-200px'},600, "easeOutBack", function(){
    	$('.thumbStrip').animate({"opacity":'0'},600, "easeOutBack");
	$('.blackStrip').animate({"opacity":'0'},600, "easeOutBack");
	$('.contactStrip').animate({"opacity":'100'},600, "easeOutBack");
	$('.aboutStrip').animate({"opacity":'0'},600, "easeOutBack");


		if($("#loader").css("display") != "none"){
			$('#loader').fadeOut("slow", insertdata( param));
			return;
		}

		$('#contentDiv').hide();
		$('#loader').fadeIn("slow").delay("700").fadeOut("slow", insertdata( param));

});
	}




//
//




	function  loadingpage( param) {


		if($("#loader").css("display") != "none"){
			$('#loader').fadeOut("slow", insertdata( param));
			return;
		}

		$('#contentDiv').hide();
		$('#loader').fadeIn("slow").delay("700").fadeOut("slow", insertdata( param));

	}




	function insertdata( param) {
	
		setTimeout(function() {$('#contentDiv').load(param).delay('500').fadeIn('slow')}, 1000);
		$("#transfooterDiv").animate({height: "15"}, "easeInOut");
		$("#footerDiv").animate({height: "5"}, "easeInOut");
               $('#bottomInfo').show();
		return false;
	}	


	function  loadingproject(page) {
		footerAnimate();
		insertproject(page);
	}	


	function insertproject(page) {
		$('#loader').hide();
		$('#contentDiv').load(page).delay('200').fadeIn('slow');
	}

	function footerAnimate(){
	$('#bottomInfo').hide();
	$('#clearDiv').hide();

    	$('#sidebarHomepage').animate({"height":'135px', 'top':'100%', 'marginTop':'-135px'},600, "easeOutBack");

  	$('#homestripBar').animate({"height":'155px','top':'100%', 'marginTop':'-155px'},600, "easeInQuad");
   // 	$('#sidebarHomepage').animate({"height":'30px','top':'100%', 'marginTop':'-30px'},600, "easeInQuad");	
//	$("#footerDiv").animate({height: "15"}, "easeInOut");
	//	$("#transfooterDiv").animate({height: "150"}, "easeInOut");
		return false;
	}


function get_random()
{
    var ranNum= Math.floor(Math.random()*4);
    return ranNum;
}


function getaQuote()
{
   var whichQuote=get_random();
   var numberSign=get_random();
   var images="/page"+whichQuote+".aspx";
var numbersign2="/page"+numberSign+".aspx";
//$('#sidebarHomeLeft').load(images);
// $('.left1').load(images);
// $('.left2').load(numbersign2);
// $('.left3').load(images);
// $('.left4').load(images);



}


