
$(function(){
		   
		   	if ((screen.width<=1024) || (screen.height<=800)) {		
	$('.windowInnerA p').css({'font-size':'1.4em','width':'63%'});
	}
	
	if (screen.width<=1024) {	
	$('#top a').css('font-size','0.95em');
	$('#topleft li').css('margin-right','10px');
	$('#topright li').css('margin-left', '10px');
	}
		   
	$('.different_link').click(function(event){
							   event.preventDefault();
							   return false;
	});

	$('a').click(function(){
			var currentId =$(this).attr('id');				
			if(currentId=='nav0'){
				$('.activeView').slideUp();
				$('.activeNav').removeClass();
				$(this).addClass("activeNav");
				$('#topnav').fadeOut("slow");
				return false;	
				}
			if(currentId=='nav1'&& !($(this).hasClass("activeNav"))){
				$('.activeView').slideUp(function(){
					$('#windowWho').slideDown("slow");
					});
				$('.activeView').removeClass();
				$('#windowWho').addClass('activeView');	
				$('.activeNav').removeClass();
				$(this).addClass("activeNav");
				$('#topnav').fadeOut("slow");
				return false;		
				}
			if(currentId=='nav2'&& !($(this).hasClass("activeNav"))){
				$('.activeView').slideUp(function(){
					$('#windowWhat').slideDown("slow");
					});
				$('.activeView').removeClass();
				$('#windowWhat').addClass('activeView');
				$('.activeNav').removeClass();
				$(this).addClass("activeNav");
				$('#topnav').fadeOut("slow");
				return false;		
				}
			if(currentId=='nav3'&& !($(this).hasClass("activeNav"))){
				$('.activeView').slideUp(function(){
					$('#windowWhere').slideDown("slow");
					});
				$('.activeView').removeClass();	
				$('#windowWhere').addClass('activeView');	
				$('.activeNav').removeClass();
				$(this).addClass("activeNav");
				$('#topnav').fadeOut("slow");
				return false;		
				}
				
			if(currentId=='nav5'&& !($(this).hasClass("activeNav"))){
				$('.activeView').slideUp(function(){
					$('#windowWTF').slideDown("slow");
					});
				$('.activeView').removeClass();	
				$('#windowWTF').addClass('activeView');	
				$('.activeNav').removeClass();
				$(this).addClass("activeNav");
				$('#topnav').fadeOut("slow");
				return false;		
				}
				
			if(currentId=='nav4'&& !($(this).hasClass("activeNav"))){
				$('.activeView').slideUp(function(){
					$('#windowWork').slideDown("slow");
					});
				$('.activeView').removeClass();
				$('#windowWork').addClass('activeView');	
				$('#topnav').fadeIn("slow");
				$('.activeNav').removeClass();
				$(this).addClass("activeNav");
				if($(this).hasClass('fresh')){
					$("ul#portfolio li").remove();
					$(images).each(function(index,value){ 
						var list = $('<li id="portfolio_'+index+'"></li>').attr('class','loading')
						$('ul#portfolio').append(list);	
						var curr = $("ul#portfolio li#portfolio_"+index);			
						var img = new Image();							
						$(img).load(function () {
							$(this).css('display','none'); 
							$(curr).removeClass('loading').append(this);
							$(this).fadeIn();
						}).error(function () {
							$(curr).remove();
						}).attr('src', value);			
					});		
					$(this).removeClass('fresh');
					
				}
				return false;		
				}
	});
	
	<!-- topnav --> 
	$('#top #interactive').click(function(){	
		$('.jobP').fadeOut();
		$('.jobB').fadeOut();
		$('#plus1').fadeOut();
		$('#plus1b').fadeOut();
		$('#plus2').fadeOut();
		$('#plus2b').fadeOut();
		$('.jobI').fadeIn();
	});
	
	$('#top #print').click(function(){		
		$('.jobI').fadeOut();		
		$('.jobB').fadeOut();
		$('#plus1').fadeOut();
		$('#plus1b').fadeOut();
		$('#plus2').fadeIn();
		$('.jobP').fadeIn();
		$('.p2').fadeOut();
		
	});
	$('#top #branding').click(function(){			
		$('.jobP').fadeOut();		
		$('.jobI').fadeOut();
		$('#plus1').fadeOut();
		$('#plus1b').fadeOut();
		$('#plus2').fadeOut();
		$('#plus2b').fadeOut();
		$('.jobB').fadeIn();
	});
	$('#top #all').click(function(){
		$('.jobI').fadeIn();	
		$('.jobP').fadeIn();		
		$('.jobB').fadeIn();
		$('#plus2').fadeOut();
		$('.a2').fadeOut();
		$('#plus1').fadeIn();
	});

	
	$('#topright li a').click(function(){
		$('#topright li a').removeClass('active');					   	
		$(this).addClass('active');
	});
	
	$('#topleft li a').click(function(){
		if (!$(this).hasClass('plus')){	
			$('#topleft li a').removeClass('active');					   	
			$(this).addClass('active');
		};
	});
	
	<!-- topnav -->
	
	<!-- Gallery-->	
		/*$('#gallery').mousemove(function(e){
			var w1 = $().width();
			var w2 = $('#gallery').width();
			var r = e.pageX / w1;
			var x = r * (w2-w1) * -1;
			if(w2>w1){			
				/*$('#gallery').stop().animate({left:x});
				$('#gallery').css('left',x);
			};  
		});*/
	
	
	$('#gallery').mousemove(function(e){
		var w1 = $().width();
		var w2 = $('#gallery').width();
		if(w2>w1){	
			var px = e.pageX;
			if(px>100 && px <(w1-100)){
				var r = (px -100) / (w1-200);
				var x = r * (w2-w1) * -1;
				$('#gallery').css('left',x);
			};
			if(px<100){
				$('#gallery').css('left',0);
			};
			if(px>(w1-100)){
				$('#gallery').css('left',(-1*(w2-w1)));
			};
		};

	});

	
	
	<!-- Portfolio -->
	
				
	images = new Array();
				images[0] = 'images/100-Plus/100-Plus-1.jpg';
				images[1] = 'images/100-Plus/100-Plus-2.jpg';
				images[2] = 'images/100-Plus/100-Plus-3.jpg';
				
	images1 = new Array();
				images1[0] = 'images/100-Plus/100-Plus-1.jpg';
				images1[1] = 'images/100-Plus/100-Plus-2.jpg';
				images1[2] = 'images/100-Plus/100-Plus-3.jpg';
				
	images2 = new Array();
				images2[0] = 'images/Australian-Air/australia-air-1.jpg';
				images2[1] = 'images/Australian-Air/australia-air-2.jpg';
				images2[2] = 'images/Australian-Air/australia-air-3.jpg';
				
	images3 = new Array();
				images3[0] = 'images/Banyan-Tree/banyan-tree-1.jpg';
				images3[1] = 'images/Banyan-Tree/banyan-tree-2.jpg';
				images3[2] = 'images/Banyan-Tree/banyan-tree-3.jpg';
				
	images4 = new Array();
				images4[0] = 'images/Happiness/happy1.jpg';
				images4[1] = 'images/Happiness/happy2.jpg';
				images4[2] = 'images/Happiness/happy3.jpg';
				images4[3] = 'images/Happiness/happy4.jpg';
				images4[4] = 'images/Happiness/happy5.jpg';
				images4[5] = 'images/Happiness/happy6.jpg';
				images4[6] = 'images/Happiness/happy7.jpg';
				images4[7] = 'images/Happiness/happy8.jpg';
				images4[8] = 'images/Happiness/happy9.jpg';
				
	images5 = new Array();
				images5[0] = 'images/Identity/bandoeng.jpg';
				images5[1] = 'images/Identity/big.jpg';
				images5[2] = 'images/Identity/by-left.jpg';
				images5[3] = 'images/Identity/get-a-crib.jpg';
				images5[4] = 'images/Identity/gryphon.jpg';
				images5[5] = 'images/Identity/LKF.jpg';
				images5[6] = 'images/Identity/martin-38.jpg';
				images5[7] = 'images/Identity/rubber-tree.jpg';
				images5[8] = 'images/Identity/seven-palms.jpg';
				images5[9] = 'images/Identity/the-king.jpg';
	
	images6 = new Array();
				images6[0] = 'images/Karihome/karihome-1.jpg';
				images6[1] = 'images/Karihome/karihome-2.jpg';
	
	images7 = new Array();
				images7[0] = 'images/Martin-38/martin-38-1.jpg';	
				images7[1] = 'images/Martin-38/martin-38-2.jpg';				
				images7[2] = 'images/Martin-38/martin-38-3.jpg';	
				images7[3] = 'images/Martin-38/martin-38-4.jpg';
				images7[4] = 'images/Martin-38/martin-38-5.jpg';
				images7[5] = 'images/Martin-38/martin-38-6.jpg';
				images7[6] = 'images/Martin-38/martin-38-7.jpg';
				images7[7] = 'images/Martin-38/martin-38-8.jpg';
				images7[8] = 'images/Martin-38/martin-38-9.jpg';
				images7[9] = 'images/Martin-38/martin-38-10.jpg';
				images7[10] = 'images/Martin-38/martin-38-11.jpg';
				
	images8 = new Array();
				images8[0] = 'images/NMWH/nmwh.jpg';
				
	images9 = new Array();
				images9[0] = 'images/PCCA/porsche-carrera-cup-asia-1.jpg';
				images9[1] = 'images/PCCA/porsche-carrera-cup-asia-2.jpg';
	
	images10 = new Array();
				images10[0] = 'images/Seven-Palms/seven-palms-13.jpg';
				images10[1] = 'images/Seven-Palms/seven-palms-12.jpg';
				images10[2] = 'images/Seven-Palms/seven-palms-14.jpg';
				images10[3] = 'images/Seven-Palms/seven-palms-3.jpg';
				images10[4] = 'images/Seven-Palms/seven-palms-2.jpg';
				images10[5] = 'images/Seven-Palms/seven-palms-4.jpg';
				images10[6] = 'images/Seven-Palms/seven-palms-5.jpg';
				images10[7] = 'images/Seven-Palms/seven-palms-6.jpg';
				images10[8] = 'images/Seven-Palms/seven-palms-7.jpg';
				images10[9] = 'images/Seven-Palms/seven-palms-8.jpg';
				images10[10] = 'images/Seven-Palms/seven-palms-9.jpg';
				images10[11] = 'images/Seven-Palms/seven-palms-10.jpg';
				images10[12] = 'images/Seven-Palms/seven-palms-11.jpg';
	
	images11 = new Array();
				images11[0] = 'images/UPS/ups-1.jpg';
				images11[1] = 'images/UPS/ups-2.jpg';
				images11[2] = 'images/UPS/ups-3.jpg';
	
	images12 = new Array();
				images12[0] = 'images/World-of-Golf/world-of-golf.jpg';
	
	images13 = new Array();
				images13[0] = 'images/Yamaha/yamaha-1.jpg';
				images13[1] = 'images/Yamaha/yamaha-2.jpg';
	
	images14 = new Array();
				images14[0] = 'images/Listerine/listerine-1.jpg';

				
	
	master = new Array();
				master[0] = images;
				master[1] = images1;
				master[2] = images2;
				master[3] = images3;
				master[4] = images4;
				master[5] = images5;
				master[6] = images6;
				master[7] = images7;
				master[8] = images8;
				master[9] = images9;
				master[10] = images10;
				master[11] = images11;
				master[12] = images12;
				master[13] = images13;
				master[14] = images14;
	
	masterWidth = new Array();
				masterWidth[0] = 2170;
				masterWidth[1] = 2170;
				masterWidth[2] = 1070;
				masterWidth[3] = 1950;
				masterWidth[4] = 6430;
				masterWidth[5] = 6760;
				masterWidth[6] = 3080;
				masterWidth[7] = 7490;
				masterWidth[8] = 350;
				masterWidth[9] = 1460;
				masterWidth[10] = 8160;
				masterWidth[11] = 2170;
				masterWidth[12] = 700;
				masterWidth[13] = 1310;
				masterWidth[14] = 650;
	
				
	projName = new Array();
				projName[0] = "100 Plus";
				projName[1] = "100 Plus";
				projName[2] = "Australia Air";
				projName[3] = "Banyan Tree";
				projName[4] = "Happiness";
				projName[5] = "Identity";
				projName[6] = "Karihome";
				projName[7] = "Martin No.38";
				projName[8] = "National Museum of Women's History";
				projName[9] = "Porsche Carrera Cup Asia";
				projName[10] = "Seven Palms";
				projName[11] = "UPS";
				projName[12] = "World of Golf";
				projName[13] = "Yamaha";
				projName[14] = "Listerine";
				
	projDesc = new Array ();
				projDesc[0] = "<p>\n" + "A limited-edition can produced exclusively for the Annual Singapore Standard Chartered Marathon." + "</p>\n" + "<p>\n" + "The imagery expresses the inner struggle and willpower to fight the pain as well as the constant thought of quitting, and how much it would take to outdo yourself." + "</p>\n"
	
				projDesc[1] = "<p>\n" + "A limited-edition can produced exclusively for the Annual Singapore Standard Chartered Marathon." + "</p>\n" + "<p>\n" + "The imagery expresses the inner struggle and willpower to fight the pain as well as the constant thought of quitting, and how much it would take to outdo yourself." + "</p>\n"
				
				projDesc[2] = "<p>\n" + "Australian Airlines is a full-service airline based in Australia. Being a budget subsidiary of Qantas with destinations to smaller cities in Australia and Asia, the target audience was younger and more open to new cultures." + "</p>\n" + "<p>\n" + "We thought: what better way to immerse yourself in another culture than through the colourful local slang." + "</p>\n"
				
				projDesc[3] = "For this series our concept was that in order to get more out of your Banyan Tree experience, you really had to have less; less technology, less distruptions, less civilization." + "</p>\n"
				
				
				projDesc[4] = "<p>\n" + "A personal project done out of pure joy to spread joy during the Chinese New Year and beyond." + "</p>\n"
				
				projDesc[5] = "<p>\n" + "Creating logos; both a pain and a joy." + "</p>\n" + "<p>\n" + "So much to say in such a little piece of design." + "</p>\n"
				
				projDesc[6] = "<p>\n" + " " + "</p>\n"
				
				projDesc[7] = "<p>\n" + "Martin No.38 by SC Global, is a luxury development that draws inspiration from converted warehouse lofts with its rugged architecture of raw concrete, base metals, and natural timbers. " + "</p>\n" + "<p>\n" + "The disparity created an edginess that was perfect for the press ads and website." + "</p>\n" + "<p>\n" + '<a href="http://www.martin38.com" target=blank>\n'+ "www.martin38.com" + "</a>\n"+"</p>\n"
				
				projDesc[8] = "<p>\n" + "An ad seeking to address and recognize the roles of women. " + "</p>\n"
				
				projDesc[9] = "<p>\n" + "A chic invite for a chic event" + "</p>\n"
				
				projDesc[10] = "<p>\n" + "Singapore's only beachfront residence.  With such a proposition, we didn't really need to say too much. " + "</p>\n" + "<p>\n" + '<a href="http://www.sevenpalms.com.sg" target=blank>\n'+ "www.sevenpalms.com.sg" + "</a>\n"+"</p>\n"
				
				projDesc[11] = "<p>\n" + "UPS wanted to create a direct mailer to announce their extended pick-up time for same day delivery. This was achieved though a simple mailer that encourages interaction with the readers while conveying the message across."
				
				projDesc[12] = "<p>\n" + "The Bridgestone TourStage VIQ. A really powerful  driver. " + "</p>\n"
				
				projDesc[13] = "<p>\n" + "For this campaign we wanted to focus entirely on the passion of making music. The sounds that were truer to the heart and soul, from the countless basement jamming sessions, scanty makeshift venues to breathtaking on stage performances." + "</p>\n"
				
				projDesc[14] = "<p>\n" + "Bad breath kills. Kills bad breath." + "</p>\n"
				
				
	
	
				
	
	
	$('#topleft li a').click(function(){
		if (!$(this).hasClass('plus')){	
			var i = $(this).attr('id')
			currentProject = master[i];
			$(this).lodemand();
			$('#desc h2').text(projName[i]);
			$('#descInner').html(projDesc[i])
			/*$('#descInner').html("<p>\n" + "fuck jonal the pussy" + "</p>\n"+"<p>\n" + "he's an asshole" + "</p>\n");*/
			$('#gallery').css({'width': masterWidth[i],'left':0});
			
		};
		
	});
	
	$('#plus1').click(function(){
		$('.a1').fadeOut();
		$('.p1').fadeOut();
		$('.a2').fadeIn();
	});
	$('#plus1b').click(function(){
		$('.a2').fadeOut();
		$('.p1').fadeOut();
		$('.a1').fadeIn();
	});
	$('#plus2').click(function(){
		$('.jobP').fadeOut();
		$('.p2').fadeIn();
		
	});
	$('#plus2b').click(function(){	
		$('.jobP').fadeIn();
		$('.p2').fadeOut();
		
	});
	<!-- Portfolio -->
	
	
	
	
		   
});
