
$(document).ready(function(){
	/*

		if($(".wrapperNull").length>0){
			$("#music-box").css("width","910px")
		}
		

		// Local copy of jQuery selectors, for performance.
		var jpPlayTime = $("#jplayer_play_time");
		var jpTotalTime = $("#jplayer_total_time");

		$("#jquery_jplayer").jPlayer({
			ready: function () {
				this.element.jPlayer("setFile",  mp3File).jPlayer("play")
			},
			swfPath:'site/layout/js/',
			volume: 50,
			// oggSupport: true,
			preload: 'none'
		})
		.jPlayer("onSoundComplete", function() {
			this.element.jPlayer("play");
		});

		$("#volp").click(function(){
			var on = $(this).attr("src").indexOf("vol.gif")==-1?true:false;

			$("#jquery_jplayer").jPlayer( on ? "volumeMax" : "volumeMin" );
			$(this).attr('src', SITE+'site/layout/images/'+( on ? "vol.gif" : "voln.gif" ) );
		});

		$("#playp").click(function(){
			var on = $(this).attr("src").indexOf("play.gif")==-1?true:false;

			$("#jquery_jplayer").jPlayer( on ? "play" : "pause" );
			$(this).attr('src', SITE+'site/layout/images/'+( on ? "play.gif" : "stop.gif" ) );
		});
*/
		
		
		$("#we-are").click(function(){
			if($(this).attr("wec")) return;
			
			$(this).attr("wec",true);
			
			
			$("#greCorner").fadeOut();
			$("#we-are ul").fadeIn();
			
			$("#we-are #box").animate({
		    // opacity: 0.25,
		    width: '343px',
		  }, 1000, function() {
				setTimeout(function(){
					$("#li1").fadeIn('slow');
				},300);
				setTimeout(function(){
					$("#li2").fadeIn('slow');
				},400);
				setTimeout(function(){
					$("#li3").fadeIn('slow');
				},450);
				
				$("#we-are #box").animate({
			    // opacity: 0.25,
			    height: '400px',
			  }, 1000, function() {
			    // Animation complete.
			  });
			
		  });
		})
	
	})

function scaleSize(img, maxW, maxH){
	
	var currH = img.height();
	var currW = img.width();
	
	var ratio = currH / currW;
	
	if(currW >= maxW && ratio <= 1){
		currW = maxW;
		currH = currW * ratio;
	} else if(currH >= maxH){
		currH = maxH;
		currW = currH / ratio;
	}

	img.attr("width",currW).attr("height",currH);
	//return [currW, currH];
}


