$(document).ready(function(){
	var category = $('body').attr("id");
	
	var pW = $(window).width();
	var pH = $(window).height();

	$('#global').click(function() {animatedcollapse.show('subnav');});
	$('#content').click(function() {animatedcollapse.hide('subnav');});
	$('#work div').click(function() {animatedcollapse.hide('subnav');});
	
	var ratio = pH/pW;
	var dimension = null;
	if(ratio <= .5){dimension = '16x9';}
	if(ratio > .5 && ratio <= .55){dimension = '8x5';}
	if(ratio > .55 && ratio <= .6){dimension = '4x3';}
	if(ratio >= .6){dimension = '5x4';}

	$('#feelthinkdo').fadeIn('fast', function() {});
	
	$('.facebook').mouseout(function(){$('img',this).attr("src","img/social-media/facebook.png");});
	$('.facebook').mouseover(function(){$('img',this).attr("src","img/social-media/facebook-on.png");});
	$('.twitter').mouseout(function(){$('img',this).attr("src","img/social-media/twitter.png");});
	$('.twitter').mouseover(function(){$('img',this).attr("src","img/social-media/twitter-on.png");});
	$('.youtube').mouseout(function(){$('img',this).attr("src","img/social-media/youtube.png");});
	$('.youtube').mouseover(function(){$('img',this).attr("src","img/social-media/youtube-on.png");});
	
	var tW = pW;
	if(category=="branding"){tW = pW-2350;}
	if(category=="web"){tW = pW-1500;}
	if(category=="3D"){tW = pW-1752;}
	
	if(tW>=0){
		$('.next').css('display','none');
		$('.prev').css('display','none');
	} else {
		$('.next').mouseover(function() {$('#thumbnails').animate({marginLeft:tW},{duration:3000});});
		$('.next').mouseout(function() {$('#thumbnails').stop();});
		$('.prev').mouseover(function() {$('#thumbnails').animate({marginLeft:"0"},{duration:3000});});
		$('.prev').mouseout(function() {$('#thumbnails').stop();});
	}
	
	//menu
   	animatedcollapse.addDiv('subnav', 'fade=1,speed=300,height=110px')
	animatedcollapse.init();
	$('#fancybox-wrap').mouseover(function() {animatedcollapse.hide('subnav');});

	//nav links
    $('#home').click(function() {
    	$('#whoweare').fadeOut('fast', function() {});
    	$('#whatwedo').fadeOut('fast', function() {});
    	$('#clients').fadeOut('fast', function() {});
    	$('#industries').fadeOut('fast', function() {});
    	$('#contact').fadeOut('fast', function() {});
		setTimeout( function() {$('#announcements').fadeIn('fast', function() {});}, 500);
	});
	
    $('#about1').click(function() {
    	$('#announcements').fadeOut('fast', function() {});
    	$('#whatwedo').fadeOut('fast', function() {});
    	$('#clients').fadeOut('fast', function() {});
    	$('#industries').fadeOut('fast', function() {});
    	$('#contact').fadeOut('fast', function() {});
		setTimeout( function() {$('#whoweare').fadeIn('fast', function() {});}, 500);
	});

    $('#about2').click(function() {
    	$('#announcements').fadeOut('fast', function() {});
    	$('#whoweare').fadeOut('fast', function() {});
    	$('#clients').fadeOut('fast', function() {});
    	$('#industries').fadeOut('fast', function() {});
    	$('#contact').fadeOut('fast', function() {});
		setTimeout( function() {$('#whatwedo').fadeIn('fast', function() {});}, 500);
	});

    $('#about3').click(function() {
    	$('#announcements').fadeOut('fast', function() {});
    	$('#whoweare').fadeOut('fast', function() {});
    	$('#whatwedo').fadeOut('fast', function() {});
    	$('#industries').fadeOut('fast', function() {});
    	$('#contact').fadeOut('fast', function() {});
		setTimeout( function() {$('#clients').fadeIn('fast', function() {});}, 500);
	});

    $('#about3a').click(function() {
    	$('#announcements').fadeOut('fast', function() {});
    	$('#whoweare').fadeOut('fast', function() {});
    	$('#whatwedo').fadeOut('fast', function() {});
    	$('#industries').fadeOut('fast', function() {});
    	$('#contact').fadeOut('fast', function() {});
		setTimeout( function() {$('#clients').fadeIn('fast', function() {});}, 500);
	});

    $('#about4').click(function() {
    	$('#announcements').fadeOut('fast', function() {});
    	$('#whoweare').fadeOut('fast', function() {});
    	$('#whatwedo').fadeOut('fast', function() {});
    	$('#clients').fadeOut('fast', function() {});
    	$('#industries').fadeOut('fast', function() {});
		setTimeout( function() {$('#contact').fadeIn('fast', function() {});}, 500);
	});

    $('#clients1').click(function() {
    	$('#clients').fadeOut('fast',function(){});
    	$('#i1').css('color','#ffffff');$('#realestate').css('display','none');
    	$('#i2').css('color','#ffffff');$('#fashion').css('display','none');
    	$('#i3').css('color','#ffffff');$('#financial').css('display','none');
    	$('#i4').css('color','#ffffff');$('#health').css('display','none');
    	$('#i5').css('color','#ffffff');$('#hospitality').css('display','none');
    	$('#i6').css('color','#ffffff');$('#industrial').css('display','none');
    	$('#i7').css('color','#ffffff');$('#nonprofit').css('display','none');
    	$('#i8').css('color','#ffffff');$('#schools').css('display','none');
	
		$('#i1').mouseout(function() {$('#i1').css('color','#ffffff');});
		$('#i2').mouseout(function() {$('#i2').css('color','#ffffff');});
		$('#i3').mouseout(function() {$('#i3').css('color','#ffffff');});
		$('#i4').mouseout(function() {$('#i4').css('color','#ffffff');});
		$('#i5').mouseout(function() {$('#i5').css('color','#ffffff');});
		$('#i6').mouseout(function() {$('#i6').css('color','#ffffff');});
		$('#i7').mouseout(function() {$('#i7').css('color','#ffffff');});
		$('#i8').mouseout(function() {$('#i8').css('color','#ffffff');});
		
		setTimeout( function(){$('#industries').fadeIn('fast',function(){});},500);
	});

    $('#i1').click(function() {
    	$('#i1').css('color','#990000');
    	$('#i2').css('color','#ffffff');$('#fashion').fadeOut('fast',function(){});
    	$('#i3').css('color','#ffffff');$('#financial').fadeOut('fast',function(){});
    	$('#i4').css('color','#ffffff');$('#health').fadeOut('fast',function(){});
    	$('#i5').css('color','#ffffff');$('#hospitality').fadeOut('fast',function(){});
    	$('#i6').css('color','#ffffff');$('#industrial').fadeOut('fast',function(){});
    	$('#i7').css('color','#ffffff');$('#nonprofit').fadeOut('fast',function(){});
    	$('#i8').css('color','#ffffff');$('#schools').fadeOut('fast',function(){});
	
		$('#i2').mouseout(function() {$('#i2').css('color','#ffffff');});
		$('#i3').mouseout(function() {$('#i3').css('color','#ffffff');});
		$('#i4').mouseout(function() {$('#i4').css('color','#ffffff');});
		$('#i5').mouseout(function() {$('#i5').css('color','#ffffff');});
		$('#i6').mouseout(function() {$('#i6').css('color','#ffffff');});
		$('#i7').mouseout(function() {$('#i7').css('color','#ffffff');});
		$('#i8').mouseout(function() {$('#i8').css('color','#ffffff');});
		
		setTimeout( function(){$('#realestate').fadeIn('fast',function(){});},500);
	});

    $('#i2').click(function() {
    	$('#i1').css('color','#ffffff');$('#realestate').fadeOut('fast',function(){});
    	$('#i2').css('color','#990000');
    	$('#i3').css('color','#ffffff');$('#financial').fadeOut('fast',function(){});
    	$('#i4').css('color','#ffffff');$('#health').fadeOut('fast',function(){});
    	$('#i5').css('color','#ffffff');$('#hospitality').fadeOut('fast',function(){});
    	$('#i6').css('color','#ffffff');$('#industrial').fadeOut('fast',function(){});
    	$('#i7').css('color','#ffffff');$('#nonprofit').fadeOut('fast',function(){});
    	$('#i8').css('color','#ffffff');$('#schools').fadeOut('fast',function(){});
	
		$('#i1').mouseout(function() {$('#i1').css('color','#ffffff');});
		$('#i3').mouseout(function() {$('#i3').css('color','#ffffff');});
		$('#i4').mouseout(function() {$('#i4').css('color','#ffffff');});
		$('#i5').mouseout(function() {$('#i5').css('color','#ffffff');});
		$('#i6').mouseout(function() {$('#i6').css('color','#ffffff');});
		$('#i7').mouseout(function() {$('#i7').css('color','#ffffff');});
		$('#i8').mouseout(function() {$('#i8').css('color','#ffffff');});
		
		setTimeout( function(){$('#fashion').fadeIn('fast',function(){});},500);
	});

    $('#i3').click(function() {
    	$('#i1').css('color','#ffffff');$('#realestate').fadeOut('fast',function(){});
    	$('#i2').css('color','#ffffff');$('#fashion').fadeOut('fast',function(){});
    	$('#i3').css('color','#990000');
    	$('#i4').css('color','#ffffff');$('#health').fadeOut('fast',function(){});
    	$('#i5').css('color','#ffffff');$('#hospitality').fadeOut('fast',function(){});
    	$('#i6').css('color','#ffffff');$('#industrial').fadeOut('fast',function(){});
    	$('#i7').css('color','#ffffff');$('#nonprofit').fadeOut('fast',function(){});
    	$('#i8').css('color','#ffffff');$('#schools').fadeOut('fast',function(){});
	
		$('#i1').mouseout(function() {$('#i1').css('color','#ffffff');});
		$('#i2').mouseout(function() {$('#i2').css('color','#ffffff');});
		$('#i4').mouseout(function() {$('#i4').css('color','#ffffff');});
		$('#i5').mouseout(function() {$('#i5').css('color','#ffffff');});
		$('#i6').mouseout(function() {$('#i6').css('color','#ffffff');});
		$('#i7').mouseout(function() {$('#i7').css('color','#ffffff');});
		$('#i8').mouseout(function() {$('#i8').css('color','#ffffff');});
		
		setTimeout( function(){$('#financial').fadeIn('fast',function(){});},500);
	});

    $('#i4').click(function() {
    	$('#i1').css('color','#ffffff');$('#realestate').fadeOut('fast',function(){});
    	$('#i2').css('color','#ffffff');$('#fashion').fadeOut('fast',function(){});
    	$('#i3').css('color','#ffffff');$('#financial').fadeOut('fast',function(){});
    	$('#i4').css('color','#990000');
    	$('#i5').css('color','#ffffff');$('#hospitality').fadeOut('fast',function(){});
    	$('#i6').css('color','#ffffff');$('#industrial').fadeOut('fast',function(){});
    	$('#i7').css('color','#ffffff');$('#nonprofit').fadeOut('fast',function(){});
    	$('#i8').css('color','#ffffff');$('#schools').fadeOut('fast',function(){});
	
		$('#i1').mouseout(function() {$('#i1').css('color','#ffffff');});
		$('#i2').mouseout(function() {$('#i2').css('color','#ffffff');});
		$('#i3').mouseout(function() {$('#i3').css('color','#ffffff');});
		$('#i5').mouseout(function() {$('#i5').css('color','#ffffff');});
		$('#i6').mouseout(function() {$('#i6').css('color','#ffffff');});
		$('#i7').mouseout(function() {$('#i7').css('color','#ffffff');});
		$('#i8').mouseout(function() {$('#i8').css('color','#ffffff');});
		
		setTimeout( function(){$('#health').fadeIn('fast',function(){});},500);
	});

    $('#i5').click(function() {
    	$('#i1').css('color','#ffffff');$('#realestate').fadeOut('fast',function(){});
    	$('#i2').css('color','#ffffff');$('#fashion').fadeOut('fast',function(){});
    	$('#i3').css('color','#ffffff');$('#financial').fadeOut('fast',function(){});
    	$('#i4').css('color','#ffffff');$('#health').fadeOut('fast',function(){});
    	$('#i5').css('color','#990000');
    	$('#i6').css('color','#ffffff');$('#industrial').fadeOut('fast',function(){});
    	$('#i7').css('color','#ffffff');$('#nonprofit').fadeOut('fast',function(){});
    	$('#i8').css('color','#ffffff');$('#schools').fadeOut('fast',function(){});
	
		$('#i1').mouseout(function() {$('#i1').css('color','#ffffff');});
		$('#i2').mouseout(function() {$('#i2').css('color','#ffffff');});
		$('#i3').mouseout(function() {$('#i3').css('color','#ffffff');});
		$('#i4').mouseout(function() {$('#i4').css('color','#ffffff');});
		$('#i6').mouseout(function() {$('#i6').css('color','#ffffff');});
		$('#i7').mouseout(function() {$('#i7').css('color','#ffffff');});
		$('#i8').mouseout(function() {$('#i8').css('color','#ffffff');});
		
		setTimeout( function(){$('#hospitality').fadeIn('fast',function(){});},500);
	});

    $('#i6').click(function() {
    	$('#i1').css('color','#ffffff');$('#realestate').fadeOut('fast',function(){});
    	$('#i2').css('color','#ffffff');$('#fashion').fadeOut('fast',function(){});
    	$('#i3').css('color','#ffffff');$('#financial').fadeOut('fast',function(){});
    	$('#i4').css('color','#ffffff');$('#health').fadeOut('fast',function(){});
    	$('#i5').css('color','#ffffff');$('#hospitality').fadeOut('fast',function(){});
    	$('#i6').css('color','#990000');
    	$('#i7').css('color','#ffffff');$('#nonprofit').fadeOut('fast',function(){});
    	$('#i8').css('color','#ffffff');$('#schools').fadeOut('fast',function(){});
	
		$('#i1').mouseout(function() {$('#i1').css('color','#ffffff');});
		$('#i2').mouseout(function() {$('#i2').css('color','#ffffff');});
		$('#i3').mouseout(function() {$('#i3').css('color','#ffffff');});
		$('#i4').mouseout(function() {$('#i4').css('color','#ffffff');});
		$('#i5').mouseout(function() {$('#i5').css('color','#ffffff');});
		$('#i7').mouseout(function() {$('#i7').css('color','#ffffff');});
		$('#i8').mouseout(function() {$('#i8').css('color','#ffffff');});
		
		setTimeout( function(){$('#industrial').fadeIn('fast',function(){});},500);
	});

    $('#i7').click(function() {
    	$('#i1').css('color','#ffffff');$('#realestate').fadeOut('fast',function(){});
    	$('#i2').css('color','#ffffff');$('#fashion').fadeOut('fast',function(){});
    	$('#i3').css('color','#ffffff');$('#financial').fadeOut('fast',function(){});
    	$('#i4').css('color','#ffffff');$('#health').fadeOut('fast',function(){});
    	$('#i5').css('color','#ffffff');$('#hospitality').fadeOut('fast',function(){});
    	$('#i6').css('color','#ffffff');$('#industrial').fadeOut('fast',function(){});
    	$('#i7').css('color','#990000');
    	$('#i8').css('color','#ffffff');$('#schools').fadeOut('fast',function(){});
	
		$('#i1').mouseout(function() {$('#i1').css('color','#ffffff');});
		$('#i2').mouseout(function() {$('#i2').css('color','#ffffff');});
		$('#i3').mouseout(function() {$('#i3').css('color','#ffffff');});
		$('#i4').mouseout(function() {$('#i4').css('color','#ffffff');});
		$('#i5').mouseout(function() {$('#i5').css('color','#ffffff');});
		$('#i6').mouseout(function() {$('#i6').css('color','#ffffff');});
		$('#i8').mouseout(function() {$('#i8').css('color','#ffffff');});
		
		setTimeout( function(){$('#nonprofit').fadeIn('fast',function(){});},500);
	});

    $('#i8').click(function() {
    	$('#i1').css('color','#ffffff');$('#realestate').fadeOut('fast',function(){});
    	$('#i2').css('color','#ffffff');$('#fashion').fadeOut('fast',function(){});
    	$('#i3').css('color','#ffffff');$('#financial').fadeOut('fast',function(){});
    	$('#i4').css('color','#ffffff');$('#health').fadeOut('fast',function(){});
    	$('#i5').css('color','#ffffff');$('#hospitality').fadeOut('fast',function(){});
    	$('#i6').css('color','#ffffff');$('#industrial').fadeOut('fast',function(){});
    	$('#i7').css('color','#ffffff');$('#nonprofit').fadeOut('fast',function(){});
    	$('#i8').css('color','#990000');
	
		$('#i1').mouseout(function() {$('#i1').css('color','#ffffff');});
		$('#i2').mouseout(function() {$('#i2').css('color','#ffffff');});
		$('#i3').mouseout(function() {$('#i3').css('color','#ffffff');});
		$('#i4').mouseout(function() {$('#i4').css('color','#ffffff');});
		$('#i5').mouseout(function() {$('#i5').css('color','#ffffff');});
		$('#i6').mouseout(function() {$('#i6').css('color','#ffffff');});
		$('#i7').mouseout(function() {$('#i7').css('color','#ffffff');});
		
		setTimeout( function(){$('#schools').fadeIn('fast',function(){});},500);
	});
	
	$('#i1').mouseover(function() {$('#i1').css('color','#990000');});
	$('#i2').mouseover(function() {$('#i2').css('color','#990000');});
	$('#i3').mouseover(function() {$('#i3').css('color','#990000');});
	$('#i4').mouseover(function() {$('#i4').css('color','#990000');});
	$('#i5').mouseover(function() {$('#i5').css('color','#990000');});
	$('#i6').mouseover(function() {$('#i6').css('color','#990000');});
	$('#i7').mouseover(function() {$('#i7').css('color','#990000');});
	$('#i8').mouseover(function() {$('#i8').css('color','#990000');});

	
	//gallery
	if(category=="branding"){var current = '.coffeebar01';}
	if(category=="web"){var current = '.cube01';}
	if(category=="3D"){var current = '.acc01';}
	var linkx = null;
	var imagex = null;
	var width = null;
	
	var isiPad = navigator.userAgent.match(/iPad/i) != null;
	if(isiPad==true){
		$('#menu').css('bottom','-100px');
		$('.next').css('right','-150px');
		$('#nav').css('width','1200px');
	}
	
	if(category=="office"){
	var current = '.office01';
	$(current).fadeIn('fast',function(){});
	$('#thumbnails li.office img').each(function(index) {
		index++;
		link = '.office0'+index+'link';
		image = '.office0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.office0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		$(image).html('<img src="../work/img/originals/0'+index+'.jpg">');
	});
	}
	
	$(current).fadeIn('fast',function(){});
	
	if(category=="web"){
		width = pW/1.5;
		height = ((pH-40)-(width/1.6))/2;
		$('#work').css('marginTop',height);
		$('#work').css('width',width);
	}
	
	if(category=="threedee" || category=="film"){
		$('#soondiv').fadeIn('slow', function() {});
		soondiv = ((pH-110)-76)/2;$('#soondiv').css('marginTop',soondiv);
		filmdiv = ((pH-110)-435)/2;$('#filmdiv').css('marginTop',filmdiv);
	}
	
	
	$('#thumbnails li.cube img').each(function(index) {
		index++;
		link = '.cube0'+index+'link';
		image = '.cube0'+index;
		image2 = '<img src="../work/img/cube/'+category+'/'+dimension+'/0'+index+'.jpg">';
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.cube0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/cube/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/cube/'+category+'/0'+index+'.jpg">');
		}
	});
	
	
	$('#thumbnails li.aetna img').each(function(index) {
		index++;
		link = '.aetna0'+index+'link';
		image = '.aetna0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.aetna0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/aetna/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/aetna/'+category+'/0'+index+'.jpg">');
		}
	});
	
	
	
	$('#thumbnails li.ten img').each(function(index) {
		index++;
		link = '.ten0'+index+'link';
		image = '.ten0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.ten0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/ten/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/ten/'+category+'/0'+index+'.jpg">');
		}
	});
	
	
	
	$('#thumbnails li.penncharter img').each(function(index) {
		index++;
		link = '.penncharter0'+index+'link';
		image = '.penncharter0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.penncharter0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/penncharter/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/penncharter/'+category+'/0'+index+'.jpg">');
		}
	});
	
	
	
	
	$('#thumbnails li.speyside img').each(function(index) {
		index++;
		link = '.speyside0'+index+'link';
		image = '.speyside0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.speyside0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/speyside/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/speyside/'+category+'/0'+index+'.jpg">');
		}
	});




	$('#thumbnails li.korman img').each(function(index) {
		index++;
		link = '.korman0'+index+'link';
		image = '.korman0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.korman0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/korman/'+category+'/'+dimension+'/0'+index+'.jpg">');
		}
		
		if(category=='web'){
			$(image).html('<img src="../work/img/korman/'+category+'/0'+index+'.jpg">');
		}
		
		if(category=='film'){
		    $(link).mousedown(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.korman0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
			if (category=='film'){
			var flashvars = {
				vidWidth: "600",
				vidHeight: "435",
				vidPath: "http://www.modworldwide.com/work/img/korman/film/Korman.flv",
				thumbPath: "http://www.modworldwide.com/work/img/korman/film/preview.jpg",
				autoPlay: "false",
				watermark: "show",
				watermarkURL: ""
			};
			var params = {
				menu: "true",
				allowfullscreen: "true",
				allowscriptaccess: "always"
			};
			var attributes = {
				id: "playerLite",
				name: "playerLite"
			};
	
			swfobject.embedSWF("http://www.modworldwide.com/fla/standalone/playerLite.swf", "playerLite", flashvars.vidWidth, flashvars.vidHeight, "9.0.0","http://www.modworldwide.com/swf/expressInstall.swf", flashvars, params, attributes);
			}
		});
    	$(link).mouseup(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.korman0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
			if (category=='film'){
			var flashvars = {
				vidWidth: "600",
				vidHeight: "435",
				vidPath: "http://www.modworldwide.com/work/img/korman/film/Korman.flv",
				thumbPath: "http://www.modworldwide.com/work/img/korman/film/preview.jpg",
				autoPlay: "false",
				watermark: "show",
				watermarkURL: ""
			};
			var params = {
				menu: "true",
				allowfullscreen: "true",
				allowscriptaccess: "always"
			};
			var attributes = {
				id: "playerLite",
				name: "playerLite"
			};
	
			swfobject.embedSWF("http://www.modworldwide.com/fla/standalone/playerLite.swf", "playerLite", flashvars.vidWidth, flashvars.vidHeight, "9.0.0","http://www.modworldwide.com/swf/expressInstall.swf", flashvars, params, attributes);
			}
		});
	}
	});
	
	
	$('#thumbnails li.mcym img').each(function(index) {
		index++;
		link = '.mcym0'+index+'link';
		image = '.mcym0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.mcym0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/mcym/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/mcym/'+category+'/0'+index+'.jpg">');
		}
	});
	
	
	$('#thumbnails li.t17 img').each(function(index) {
		index++;
		link = '.t170'+index+'link';
		image = '.t170'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.t170'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/t17/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/t17/'+category+'/0'+index+'.jpg">');
		}
	});


	$('#thumbnails li.mod img').each(function(index) {
		index++;
		link = '.mod0'+index+'link';
		image = '.mod0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.mod0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
			if (category=='film'){
			var flashvars = {
				vidWidth: "600",
				vidHeight: "435",
				vidPath: "http://www.modworldwide.com/MOD_Reel_2009.flv",
				thumbPath: "http://www.modworldwide.com/thumb-video.jpg",
				autoPlay: "false",
				watermark: "show",
				watermarkURL: ""
			};
			var params = {
				menu: "true",
				allowfullscreen: "true",
				allowscriptaccess: "always"
			};
			var attributes = {
				id: "playerLite",
				name: "playerLite"
			};
	
			swfobject.embedSWF("http://www.modworldwide.com/fla/standalone/playerLite.swf", "playerLite", flashvars.vidWidth, flashvars.vidHeight, "9.0.0","http://www.modworldwide.com/swf/expressInstall.swf", flashvars, params, attributes);
			}
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/mod/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else if (category=='web'){
			$(image).html('<img src="../work/img/mod/'+category+'/0'+index+'.jpg">');
		}
	});
	
	
	
	
	
	$('#thumbnails li.skelaxin img').each(function(index) {
		index++;
		link = '.skelaxin0'+index+'link';
		image = '.skelaxin0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.skelaxin0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/skelaxin/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/skelaxin/'+category+'/0'+index+'.jpg">');
		}
	});
	
	
	
	
	
	
	$('#thumbnails li.thrombin img').each(function(index) {
		index++;
		link = '.thrombin0'+index+'link';
		image = '.thrombin0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.thrombin0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/thrombin/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/thrombin/'+category+'/0'+index+'.jpg">');
		}
	});
	

	$('#thumbnails li.boyds img').each(function(index) {
		index++;
		link = '.boyds0'+index+'link';
		image = '.boyds0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.boyds0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);

		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/boyds/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/boyds/'+category+'/0'+index+'.jpg">');
		}
	});
	



	$('#thumbnails li.hughes img').each(function(index) {
		index++;
		link = '.hughes0'+index+'link';
		image = '.hughes0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.hughes0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='branding' || category=='threedee'){
			$(image).html('<img src="../work/img/hughes/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/hughes/'+category+'/0'+index+'.jpg">');
		}
	});
	



	$('#thumbnails li.allandomb img').each(function(index) {
		index++;
		link = '.allandomb0'+index+'link';
		image = '.allandomb0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.allandomb0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		if(category=='3D'){
			$(image).html('<img src="../work/img/allandomb/'+category+'/'+dimension+'/0'+index+'.jpg">');
		} else {
			$(image).html('<img src="../work/img/allandomb/'+category+'/0'+index+'.jpg">');
		}
	});



	$('#thumbnails li.acc img').each(function(index) {
		index++;
		link = '.acc0'+index+'link';
		image = '.acc0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.acc0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		$(image).html('<img src="../work/img/acc/'+category+'/'+dimension+'/0'+index+'.jpg">');
	});



	$('#thumbnails li.olive img').each(function(index) {
		index++;
		link = '.olive0'+index+'link';
		image = '.olive0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.olive0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		$(image).html('<img src="../work/img/olive/'+category+'/'+dimension+'/0'+index+'.jpg">');
	});



	$('#thumbnails li.thomas img').each(function(index) {
		index++;
		link = '.thomas0'+index+'link';
		image = '.thomas0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.thomas0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		$(image).html('<img src="../work/img/thomas/'+category+'/'+dimension+'/0'+index+'.jpg">');
	});



	$('#thumbnails li.monastery img').each(function(index) {
		index++;
		link = '.monastery0'+index+'link';
		image = '.monastery0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.monastery0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		$(image).html('<img src="../work/img/monastery/'+category+'/'+dimension+'/0'+index+'.jpg">');
	});



	$('#thumbnails li.coffeebar img').each(function(index) {
		index++;
		link = '.coffeebar0'+index+'link';
		image = '.coffeebar0'+index;
    	$(link).click(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.coffeebar0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
		});
		
		$(image).html('<img src="../work/img/coffeebar/'+category+'/'+dimension+'/0'+index+'.jpg">');
	});
	
	
	
		$('#thumbnails li.twoliberty img').each(function(index) {
		index++;
		link = '.twoliberty0'+index+'link';
		image = '.twoliberty0'+index;
    	$(link).mousedown(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.twoliberty0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
			if (category=='film'){
			var flashvars = {
				vidWidth: "600",
				vidHeight: "435",
				vidPath: "http://www.modworldwide.com/work/img/twoliberty/film/TwoLib.flv",
				thumbPath: "http://www.modworldwide.com/work/img/twoliberty/film/preview.jpg",
				autoPlay: "false",
				watermark: "show",
				watermarkURL: ""
			};
			var params = {
				menu: "true",
				allowfullscreen: "true",
				allowscriptaccess: "always"
			};
			var attributes = {
				id: "playerLite",
				name: "playerLite"
			};
	
			swfobject.embedSWF("http://www.modworldwide.com/fla/standalone/playerLite.swf", "playerLite", flashvars.vidWidth, flashvars.vidHeight, "9.0.0","http://www.modworldwide.com/swf/expressInstall.swf", flashvars, params, attributes);
			}
		});
    	$(link).mouseup(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.twoliberty0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
			if (category=='film'){
			var flashvars = {
				vidWidth: "600",
				vidHeight: "435",
				vidPath: "http://www.modworldwide.com/work/img/twoliberty/film/TwoLib.flv",
				thumbPath: "http://www.modworldwide.com/work/img/twoliberty/film/preview.jpg",
				autoPlay: "false",
				watermark: "show",
				watermarkURL: ""
			};
			var params = {
				menu: "true",
				allowfullscreen: "true",
				allowscriptaccess: "always"
			};
			var attributes = {
				id: "playerLite",
				name: "playerLite"
			};
	
			swfobject.embedSWF("http://www.modworldwide.com/fla/standalone/playerLite.swf", "playerLite", flashvars.vidWidth, flashvars.vidHeight, "9.0.0","http://www.modworldwide.com/swf/expressInstall.swf", flashvars, params, attributes);
			}
		});
	
	
	
		$('#thumbnails li.radiolofts img').each(function(index) {
		index++;
		link = '.radiolofts0'+index+'link';
		image = '.radiolofts0'+index;
    	$(link).mousedown(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.radiolofts0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
			if (category=='film'){
			var flashvars = {
				vidWidth: "600",
				vidHeight: "435",
				vidPath: "http://www.modworldwide.com/work/img/radiolofts/film/RL_Reel_12_10.flv",
				thumbPath: "http://www.modworldwide.com/work/img/radiolofts/film/preview.jpg",
				autoPlay: "false",
				watermark: "show",
				watermarkURL: ""
			};
			var params = {
				menu: "true",
				allowfullscreen: "true",
				allowscriptaccess: "always"
			};
			var attributes = {
				id: "playerLite",
				name: "playerLite"
			};
	
			swfobject.embedSWF("http://www.modworldwide.com/fla/standalone/playerLite.swf", "playerLite", flashvars.vidWidth, flashvars.vidHeight, "9.0.0","http://www.modworldwide.com/swf/expressInstall.swf", flashvars, params, attributes);
			}
		});
    	$(link).mouseup(function() {
    		$(current).fadeOut('fast',function(){});
			current = '.radiolofts0'+index;
			setTimeout( function() {$(current).fadeIn('fast', function() {});}, 500);
			if (category=='film'){
			var flashvars = {
				vidWidth: "600",
				vidHeight: "435",
				vidPath: "http://www.modworldwide.com/work/img/radiolofts/film/RL_Reel_12_10.flv",
				thumbPath: "http://www.modworldwide.com/work/img/radiolofts/film/preview.jpg",
				autoPlay: "false",
				watermark: "show",
				watermarkURL: ""
			};
			var params = {
				menu: "true",
				allowfullscreen: "true",
				allowscriptaccess: "always"
			};
			var attributes = {
				id: "playerLite",
				name: "playerLite"
			};
	
			swfobject.embedSWF("http://www.modworldwide.com/fla/standalone/playerLite.swf", "playerLite", flashvars.vidWidth, flashvars.vidHeight, "9.0.0","http://www.modworldwide.com/swf/expressInstall.swf", flashvars, params, attributes);
			}
		});
	});
	});
});
