
			
			
			
			
			
			//DEV:
			//var root = "/skdotcom/";
			//var ajaxControllerUrl = "/skdotcom/index.php/ajax";
			
			//LIVE:
			var root = "/";
			var ajaxControllerUrl = "/index.php/ajax";
			
			
			var currentFrame = 1;
			//Default to 'Featured' Category
			var currentCategoryId = 1;
			
			var allowAnimation = true;
			
			var consoleView = false;
			
			var hintUp = false;
			
			var currentConsoleFrame = 1;
			
			var currentCategoryCount = 0;
			
			var textHolderTop = 105;
			
			var minHeight = 649;
			var minWidth = 940;
			
			var tmp = 0;
			
			var browserHeight = $(window).height();
			var browserWidth = $(window).width();
			
			var spaceAllowed = false;
			
			var vimeoPlayers = new Array();
			
			
			function scaleFrames(){
			
				browserHeight = $(window).height();
				browserWidth = $(window).width();
				
				//with preceding entry
				//$('#entriesSlide').css('left', -1*browserWidth);
				
				//edit to start on only first entry
				if(currentFrame == 1){
					$('#entriesSlide').css('left', 0);	
					$('#consoleFrame').css('left', 0);
				}else{
					$('#consoleFrame').css('left', browserWidth);
					$('#entriesSlide').css('left',-1*$(window).width());
				}
				
				
				//when this goes live it will be 3*browserWidth, larger to debug
				$('#entriesSlide').css('width', 4*browserWidth);
				
				//hide all textholders. we will  turn on the active frame one further down...
				$('.textholder').hide();
				//177
				
				$('.frame').each(function(){
					
					var backgroundImage = $(this).children('img.background').first();
					var backgroundImageRatio = backgroundImage.height() / backgroundImage.width();
					
					$(this).height(browserHeight);
					$(this).width(browserWidth);
					
					
					// Scale the image
					if ((browserHeight/browserWidth) > backgroundImageRatio){
					    backgroundImage.height(browserHeight);
					    backgroundImage.width(browserHeight / backgroundImageRatio);
					} else {
					    backgroundImage.width(browserWidth);
					    backgroundImage.height(browserWidth * backgroundImageRatio);
					}
					
					// Center the image
					backgroundImage.css('left', (browserWidth - backgroundImage.width())/2);
					backgroundImage.css('top', (browserHeight - backgroundImage.height())/2);
					

					//scale the videos
					if($(this).children('.vimeo').length >= 1){
						var thisVimeo = $(this).children('.vimeo').first();
						videoRatio = $(thisVimeo).attr('height') / $(thisVimeo).attr('width');
						
						if ((browserHeight/browserWidth) > videoRatio){
						    
						    $(thisVimeo).attr('height', browserHeight);
						    $(thisVimeo).attr('width', browserHeight / videoRatio);
						    
						} else {
						    $(thisVimeo).attr('height', browserWidth * videoRatio);
						    $(thisVimeo).attr('width', browserWidth);
						}
						
						// Center the video
						$(thisVimeo).css('left', (browserWidth - $(thisVimeo).attr('width'))/2);
						$(thisVimeo).css('top', (browserHeight - $(thisVimeo).attr('height'))/2);
						$(thisVimeo).css('zIndex', -1);
				
					}
										 
					
				});	
				
				
				//console slide is always 3 frames wide
				$('#consoleSlide').width(4*browserWidth);
				$('#consoleSlide').height(browserHeight);
				
				//maintain console positioning
				$('#consoleFrame').width(browserWidth);
				$('#consoleFrame').height(browserHeight);
				
				$('#consoleFrame').css('top', 0);
				
				
				
				$('#consoleSlide').css('left', -1*(currentConsoleFrame-1)*browserWidth);
				
				//enforce nav
				$('#mainFrame').css('left', 0);
				$('#mainFrame').css('top', 0);
				
				if(consoleView){
					$('#entriesSlide').css('top',-1*browserHeight);
				}else{
					$('#entriesSlide').css('top',0);
				}
				
				//edit this, entries slide should always be on screen, make console slide slide ontop of all content
//				if(consoleView == true){
//					$('#entriesSlide').css('top', -1*browserHeight);	
//				}
				
				
				
				
				//handle navigation disabling for boundary conditions
				//alert("currentFrame: "+currentFrame+", currentCategoryCount: "+currentCategoryCount+", length of entryFrames: "+$('#entryFrames .frame').length);
				if(!consoleView){
					if(currentFrame == currentCategoryCount){
						$('#next').hide();
					}
					else if(currentFrame < currentCategoryCount){
						$('#next').show();
					}
					if(currentFrame == 1){
						$('#previous').hide();
					}else if(currentFrame > 1){
						$('#previous').show();
					}
				}
			
				
				//articles body positioning:
				var articleBgH = $('#resumeFrame').children('img.background').first().height();
				var articleBgDelta = (articleBgH - browserHeight);
				$('#resumeFrame .entryBody').css('top', 100 - (browserHeight+articleBgDelta));
				
				//contact page positioning:
				var contactBgH = $('#contactFrame').children('img.background').first().height();
				var contactBgDelta = (contactBgH - browserHeight);
				var contactTop = ((-1*browserHeight/2) - ($('#contactFrame .entryBody').height()/2) - contactBgDelta + 40);
				$('#contactFrame .entryBody').css('top',contactTop);
				
			
				//crest navigation positioning:
			
				$('#categoriesCrest').removeClass('crestFixed');
				
				var categoriesBgH = $('#categoriesFrame').children('img.background').first().height();
				var categoriesBgDelta = (categoriesBgH - browserHeight);
				var crestTop = ((-1*browserHeight/2) - ($('#categoriesCrest').height()/2) - categoriesBgDelta - 80);
				$('#categoriesCrest').css('top',crestTop);	
			
				
				$('.playerHolder').hide();
				$('#frame'+currentFrame+" .playerHolder").first().show();
				
				
				
				//textholder positionings
				var entryBgH = $('#frame'+currentFrame).children('img.background').first().height();
				var entryBgDelta = (entryBgH - browserHeight);
				var entryBodyTop = browserHeight-1*(entryBgDelta)-textHolderTop;
				var entryBodyTop = browserHeight-textHolderTop;
				
					
				//handle on current text holder	
				var currentTextHolder = $('#frame'+currentFrame).children('.textholder').first();
				if(!consoleView){
					$(currentTextHolder).show();
				}
				//you will want to position these based on if the active textholder is open or not, to leave it open while scaling.
				//for now, we will close the holder when screen resize is triggered.
				
				//if textholder is expanded, restore to original position
				
				
				//fixme
				//$('.textholder').first().css('height', 51);
				
				
				
				
				
				//now make adjustments to default positioning allowing for min. res
				if(browserHeight < minHeight){
				
					$(currentTextHolder).addClass('partialScreenY');
					
					if(browserWidth < minWidth){
						$(currentTextHolder).addClass('partialScreenX');
						/*$(currentTextHolder).css('left',469);*/
					}else{
						$(currentTextHolder).removeClass('partialScreenX');
						/*$(currentTextHolder).css('left',browserWidth/2);*/	
					}
				}else{
					$(currentTextHolder).css('top',entryBodyTop);
					$(currentTextHolder).removeClass('partialScreenY');

					if(browserWidth < minWidth){
						$(currentTextHolder).addClass('partialScreenX');
					}
					else{
						$(currentTextHolder).removeClass('partialScreenX');
						$(currentTextHolder).css('left',browserWidth/2);	
					}

				}
					
				
				if(browserWidth< 940){
					$('#next').addClass('partialScreenNext');
				}else{
					$('#next').removeClass('partialScreenNext')
				}
				
				
				
				$('.articleMid').not('#contactFrame .articleMid').css('height', browserHeight-370);
				
				
				
			}//end scaleFrames
			
				
			function bindVimeoToControls(id){
				
				//alert("bound em.");	
	
	            var player = document.querySelector("#vimeo"+id);
	             $f(player).addEvent("ready", vimeoPlayerReady);
	            //$f(player).addEvent("vimeoPlayerReady", ready);
	            
	             vimeoPlayers.push(player);   
	             
			}
		
			function addEvent(element, eventName, callback) {
                if (element.addEventListener) {
                    element.addEventListener(eventName, callback, false);
                }
                else {
                    element.attachEvent(eventName, callback, false);
                }
            }
			
			 function vimeoPlayerReady(player_id) {
	            // Keep a reference to Froogaloop for this player
	            var container = document.getElementById(player_id).parentNode.parentNode,
	                froogaloop = $f(player_id);
	        
	                var buttonsHolder = document.querySelector("#"+player_id).parentNode.querySelector(".entrySmallBody"),
	                    playBtn = buttonsHolder.querySelector(".play"),
	                    pauseBtn = buttonsHolder.querySelector(".pause");
	              
//	                addEvent(playBtn, "click", function() {
//	                    froogaloop.api("play");
//	                }, false);
	
	                $("#"+player_id).parent().find(".play").click(function(){
	                	froogaloop.api("play");
	                });
	              
//	                addEvent(pauseBtn, "click", function() {
//	                    froogaloop.api("pause");
//	                }, false);
	                
	                $("#"+player_id).parent().find(".pause").click(function(){
	                	froogaloop.api("pause");
	                });
	            
	        }
	        
	            
			
			
			function loadHtmlOfOrdinalEntryInCategory(targetFrameNumber, categoryId){
				//alert("target frame: "+targetFrameNumber);
				//ajax JSON request the data:
				$('.pause').click();
				$.getJSON(ajaxControllerUrl+"/getOrdinalInCategory/"+targetFrameNumber+'/'+categoryId, function(data) {
					  		
							$('#frame'+targetFrameNumber).html(data.frameHtml);
					  		
							$('#frame'+targetFrameNumber+' .scroll-pane').jScrollPane({verticalDragMinHeight: 46, verticalDragMaxHeight: 46});
					  		//Cufon.replace('#frame'+targetFrameNumber+' .scroll-pane', { fontFamily: 'minion' });
					  		
					  		scaleFrames();  
					  		allowAnimation = true;
						});
				
				
				  
			}
			
			
			 
			function doPrevious(){
				
				//$('.textholder').css('height', 51);
				$('.textholder').hide();
				$('.pause').click();
				$('.playerHolder').hide();
					
				if(!consoleView){
					currentFrame--;
					
					//alert("doing previous and currentFrame has decremented to: "+currentFrame);
					
					$('#entriesSlide').animate({ left: "+="+$(window).width()+"px"}, 1000, "easeInOutQuart", function(){ 
						/*remove the active + 2 frame, load content in active - 1 */ 
							if(currentFrame >= 1){
								//alert("total entry frames are: "+$('#entryFrames  .frame').length+" we are removing frame: "+$('#entryFrames  .frame').last().attr('id'));
								
								var frameOnDeck = currentFrame - 1;
								if(frameOnDeck >= 1){
									//alert("currentFrame has decremented to: "+currentFrame+" and we are injecting : frame"+frameOnDeck);
									$('#entryFrames').prepend("<div class='frame' id='frame"+frameOnDeck+"'></div>");
									loadHtmlOfOrdinalEntryInCategory(frameOnDeck, currentCategoryId);
										
								}
								if(currentFrame < currentCategoryCount-1){
									$('#entryFrames .frame').last().remove();
								}
								
							}
							scaleFrames();	
							allowAnimation = true;
						});
				}
			}
			
			function doNext(){
				var tmp = $('#frame'+currentFrame).find('.textholder').first();
//				if($(tmp).height() > 150){
//					allowAnimation = true;
//					$(tmp).children('.pullHandle').first().click();
//				}
				
				//$('.textholder').css('height', 51);
				$('.textholder').hide();
				
				//$('#frame'+currentFrame+' .pause').click();
				
				
				$('.pause').click();
				
				$('.playerHolder').hide();
				
				//alert('currentframe: '+currentFrame);
				
				
				if(!consoleView){
					currentFrame++;
					
					//alert("doing next and currentFrame has incremented to: "+currentFrame);
					/*remove the active - 2 frame if present, load content in active + 1 */
					
					$('#entriesSlide').animate({ left: "-="+$(window).width() + "px"}, 1000, "easeInOutQuart", function(){ 
						
							
						if(currentFrame <= currentCategoryCount){
							
							var frameOnDeck = currentFrame + 1;
							if(frameOnDeck <= currentCategoryCount){
								//alert("insert frame: frame"+frameOnDeck);
								$('#entriesClear').before("<div class='frame' id='frame"+frameOnDeck+"'></div>");
								//ajax preload the next entry in category into the frame on deck
								loadHtmlOfOrdinalEntryInCategory(frameOnDeck, currentCategoryId);	
							}
								
							if(currentFrame > 2){
								//alert("removing frame: "+$('#entryFrames  .frame').first().attr('id'));
								$('#entryFrames  .frame').first().remove();
							}
							
						}
					
						scaleFrames();
						allowAnimation = true;
						
					});
					
				}
				
			}
			
			
			
			
			
			function currentConsoleViewToConsoleView(targetView){
				
				var direction = currentConsoleFrame - targetView;
				
				$('#consoleSlide').animate({ left: "+="+(direction*$(window).width()) + "px"}, 1000, "easeInOutQuart", function(){ 
					currentConsoleFrame = targetView;
					scaleFrames();
					allowAnimation = true;
				}  );
			}
			
			
			
			
			
			function showCategories(){
				$('.textholder').hide();
				$('#next').hide();
				$('#previous').hide();
				$('.playerHolder').remove();
				$('.pause').click();
				
				if(consoleView){
					currentConsoleViewToConsoleView(2);
					
				}else{
					$('#consoleSlide').css('left',-1*$(window).width());
					consoleView = true;
					currentConsoleFrame = 2;
					
					$('#entriesSlide').animate({ top: "-="+$(window).height() + "px"}, 1000, "easeInOutQuart", function(){ 
						scaleFrames();
						allowAnimation = true;
					});	
				}
				
				
				
			}
			
			function showResume(){
				
				$('.textholder').hide();
				$('#next').hide();
				$('#previous').hide();
				$('.playerHolder').remove();
				$('.pause').click();
				
				if(consoleView){
					currentConsoleViewToConsoleView(1);
					
				}else{
					$('#consoleSlide').css('left',0);
					currentConsoleFrame = 1;
					consoleView = true;
					
					$('#entriesSlide').animate({ top: "-="+$(window).height() + "px"}, 1000, "easeInOutQuart", function(){ 
						/*remove the active - 2 frame, load content in active + 1 */
						 //ajax load the next entry in category
						 
						 scaleFrames();
						 allowAnimation = true;
						 
					}  );
				}
				
			}
			
			
			
			function showContactForm(){
				
				$('.textholder').hide();
				$('#next').hide();
				$('#previous').hide();
				$('.playerHolder').remove();
				$('.pause').click();
				
				if(consoleView){
					currentConsoleViewToConsoleView(3);
				}
				else{
					$('#consoleSlide').css('left',-2*$(window).width());
					
					currentConsoleFrame = 3;
					consoleView = true;
					$('#entriesSlide').animate({ top: "-="+$(window).height() + "px"}, 1000, "easeInOutQuart", function(){ 
						/*remove the active - 2 frame, load content in active + 1 */
						 //ajax load the next entry in category
						 
						 scaleFrames();
						 allowAnimation = true;
						 
					}  );	
				}
				
				
			}
			
			
			
			function setCurrentCategory(id){
				
				if(allowAnimation){
					 allowAnimation = false;
					 $('.pause').click();
					 
					 $.getJSON(ajaxControllerUrl+"/getFirstTwoEntriesInCategory/"+id, function(data) {
							
						currentFrame = 1;
						currentCategoryId = id;
						currentCategoryCount = data.categoryCount;

						$('#entryFrames').html(data.firstTwoFramesHtml);
						
						//$('#frame1 .scroll-pane').jScrollPane({verticalDragMinHeight: 46, verticalDragMaxHeight: 46});
						//$('#frame2 .scroll-pane').jScrollPane({verticalDragMinHeight: 46, verticalDragMaxHeight: 46});
						
						$('.textholder').show();
						$('.scroll-pane').jScrollPane({verticalDragMinHeight: 46, verticalDragMaxHeight: 46});
						$('.resume-pane').jScrollPane({verticalDragMinHeight: 46, verticalDragMaxHeight: 46});
						
						$('.textholder').hide();
						
						
						//$('.playerHolder').hide();
						$('.jp-player').jPlayer( "stop" );
						
						scaleFrames();
						
						$('#entriesSlide').animate({ top: "+="+$(window).height() + "px"}, 1000, "easeInOutQuart", function(){ 
							/*remove the active - 2 frame, load content in active + 1 */
							 //ajax load the next entry in category
							 consoleView = false; 
							 scaleFrames();
							 allowAnimation = true;
							
						});	
						
						
					});
				}
				
				
			}
			
			function createJPlayerPlaylist(instance, playlist){
					
				
					var Playlist = function(instance, playlist) {
					
					var self = this;
					var options = {
							ready: function() {
								audioPlaylist.displayPlaylist();
								audioPlaylist.playlistInit(false); // Parameter is a boolean for autoplay.
							},
							ended: function() {
								audioPlaylist.playlistNext();
							},
							play: function() {
								$(this).jPlayer("pauseOthers");
							},
							swfPath: root+"js",
							supplied: "mp3"
						};
					this.instance = instance; // String: To associate specific HTML with this playlist
					this.playlist = playlist; // Array of Objects: The playlist
					this.options = options; // Object: The jPlayer constructor options for this playlist

					this.current = 0;

					this.cssId = {
							jPlayer: "jquery_jplayer_",
							interface: "jp_interface_",
							playlist: "jp_playlist_"
						};
						this.cssSelector = {};

						$.each(this.cssId, function(entity, id) {
							self.cssSelector[entity] = "#" + id + self.instance;
						});
					
					this.cssId.jPlayer = instance;

					if(!this.options.cssSelectorAncestor) {
						this.options.cssSelectorAncestor = this.cssSelector.interface;
					}

					$(this.cssSelector.jPlayer).jPlayer(this.options);

					$(this.cssSelector.interface + " .jp-previous").click(function() {
						self.playlistPrev();
						$(this).blur();
						return false;
					});

					$(this.cssSelector.interface + " .jp-next").click(function() {
						self.playlistNext();
						$(this).blur();
						return false;
					});
				};

				Playlist.prototype = {
					displayPlaylist: function() {
						var self = this;
						$(this.cssSelector.playlist + " ul").empty();
						for (i=0; i < this.playlist.length; i++) {
							var listItem = (i === this.playlist.length-1) ? "<li class='jp-playlist-last'>" : "<li>";
							listItem += "<a href='#' id='" + this.cssId.playlist + this.instance + "_item_" + i +"' tabindex='1'>"+ this.playlist[i].name +"</a>";

							// Create links to free media
							if(this.playlist[i].free) {
								var first = true;
								listItem += "<div class='jp-free-media'>(";
								$.each(this.playlist[i], function(property,value) {
									if($.jPlayer.prototype.format[property]) { // Check property is a media format.
										if(first) {
											first = false;
										} else {
											listItem += " | ";
										}
										listItem += "<a id='" + self.cssId.playlist + self.instance + "_item_" + i + "_" + property + "' href='" + value + "' tabindex='1'>" + property + "</a>";
									}
								});
								listItem += ")</span>";
							}

							listItem += "</li>";

							// Associate playlist items with their media
							$(this.cssSelector.playlist + " ul").append(listItem);
							$(this.cssSelector.playlist + "_item_" + i).data("index", i).click(function() {
								var index = $(this).data("index");
								if(self.current !== index) {
									self.playlistChange(index);
								} else {
									$(self.cssSelector.jPlayer).jPlayer("play");
								}
								$(this).blur();
								return false;
							});

							// Disable free media links to force access via right click
							if(this.playlist[i].free) {
								$.each(this.playlist[i], function(property,value) {
									if($.jPlayer.prototype.format[property]) { // Check property is a media format.
										$(self.cssSelector.playlist + "_item_" + i + "_" + property).data("index", i).click(function() {
											var index = $(this).data("index");
											$(self.cssSelector.playlist + "_item_" + index).click();
											$(this).blur();
											return false;
										});
									}
								});
							}
						}
					},
					playlistInit: function(autoplay) {
						//or here to hide the playlist
						//$('#playerHolder'+instance).hide();
						
						if(autoplay) {
							this.playlistChange(this.current);
						} else {
							this.playlistConfig(this.current);
						}
					},
					playlistConfig: function(index) {
						$(this.cssSelector.playlist + "_item_" + this.current).removeClass("jp-playlist-current").parent().removeClass("jp-playlist-current");
						$(this.cssSelector.playlist + "_item_" + index).addClass("jp-playlist-current").parent().addClass("jp-playlist-current");
						this.current = index;
						$(this.cssSelector.jPlayer).jPlayer("setMedia", this.playlist[this.current]);
					},
					playlistChange: function(index) {
						this.playlistConfig(index);
						$(this.cssSelector.jPlayer).jPlayer("play");
					},
					playlistNext: function() {
						var index = (this.current + 1 < this.playlist.length) ? this.current + 1 : 0;
						this.playlistChange(index);
					},
					playlistPrev: function() {
						var index = (this.current - 1 >= 0) ? this.current - 1 : this.playlist.length - 1;
						this.playlistChange(index);
					}
				};
				
				
				//instantiate the playlist
				var audioPlaylist = new Playlist(instance,playlist);
				

				
			}
			
			$(document).ready(function(){
				
				//load current category count
				//(this might be more effective as a php variable and making this js file js.php...)
				currentCategoryCount = $('#featuredCategoryCount').val();
				
				//initial config setup:
				
	
				
				scaleFrames();
				$('.textholder').show();
				$('.scroll-pane').jScrollPane({verticalDragMinHeight: 46, verticalDragMaxHeight: 46});
				$('.resume-pane').jScrollPane({verticalDragMinHeight: 46, verticalDragMaxHeight: 46});
				
				$('.textholder').hide();
				scaleFrames();
				
				$(window).bind("resize", function() { scaleFrames(); });
				
				$('#previous').click(function(){ if(allowAnimation){ allowAnimation = false; doPrevious(); } });
				$('#next').click(function(){ if(allowAnimation){ allowAnimation = false; doNext(); } });
				
				$('#categoriesLink').click(function(){ if(allowAnimation){ allowAnimation = false; showCategories(); } });
				$('#resumeLink').click(function(){ if(allowAnimation){ allowAnimation = false; showResume(); } });
				$('#contactLink').click(function(){ if(allowAnimation){ allowAnimation = false; showContactForm(); }  });
				
				
				
				//$('.ajaxLink').click(function(){});

				//Cufon.replace('scroll-pane', { fontFamily: 'minion' });
				//Cufon.replace('.minion', { fontFamily: 'minion' });
				
				
				
				
				$('.pullHandle').live("click",function(){
					
					if(allowAnimation){
						var direction = 1;
						if($(this).parent().height() > 150){ direction = -1; }
						
						
						allowAnimation = false;
						$(this).parent().animate({top: '-='+direction*177,
						    height: '+='+direction*177
						    
						  }, 500, function() {
						    // Animation complete.
							  allowAnimation = true;
						  });
					}
					    
				});
				
				$('.pullHandle').live("mouseover", function(){
					if(allowAnimation && !hintUp){
						
						allowAnimation = false;
						$(this).parent().animate({
						    top: '-=10',
						    height: '+=10'
						    
						  }, 80, function() {
						    // Animation complete.
							  allowAnimation = true;
							  hintUp = true;
						  });
					}
				});
				$('.pullHandle').live("mouseleave", function(){
					if(allowAnimation && hintUp){
						
						allowAnimation = false;
						$(this).parent().animate({
						    top: '+=10',
						    height: '-=10'
						    
						  }, 80, function() {
						    // Animation complete.
							  allowAnimation = true;
							  hintUp = false;
						  });
					}
				});
				
				$('#next, #previous, #contactLink, #resumeLink, #categoriesLink, #send, #downloadResume').live("mouseover", function(){
					$(this).css('backgroundPosition','bottom');
				});
				$('#next, #previous, #contactLink, #resumeLink, #categoriesLink, #send, #downloadResume').live("mouseleave", function(){
					$(this).css('backgroundPosition','top');
				});
				
				$('#categoriesCrest li').hover(function(){ $(this).addClass('greenHilite');},function(){$(this).removeClass('greenHilite');});
				
				
				$('.play, .pause').live("mouseleave", function(){
					$(this).removeClass('hover');
				});
				
				$('.play, .pause').live("mouseover", function(){
					$(this).addClass('hover');
				});
				
				
				$('#downloadResume').click(function(){
					window.location = "ShawnKilmer_Resume_May2011.pdf";
				});
				
				
				$('#email2').focus(function(){ if($(this).val()=='Your Email'){ $(this).val(''); } });
				$('#message').focus(function(){ spaceAllowed = true; if($(this).val()=='Your Message.'){ $(this).val(''); } });
				$('#email2').blur(function(){ if($(this).val()==''){ $(this).val('Your Email'); } });
				$('#message').blur(function(){ spaceAllowed = false; if($(this).val()==''){ $(this).val('Your Message.'); } });
				
				$('#send').click(function(){
					if($('#email').val() != ''){
						$.post(ajaxControllerUrl+"/submitContactMessage", { email: $('#email2').val(), message:$('#message').val()  }, function(data) {
							 
							if(data.success == 1){
								$('#email2').before("<div style='padding-top:120px; padding-left:70px;'>Message sent.</div>");
								$('#email2').hide();
								$('#message').hide();
								$('#send').hide();
							}else{
								$('#email2').css('color','#FF0000');
							}
						},'json');
					}
				});
				
				
				
				//$('.articleMid').jScrollPane({verticalDragMinHeight: 46, verticalDragMaxHeight: 46});
				
				$('*').keydown(function(e) {
					//disable navigation buttons
					//it would be cool to add arrow keys navigation
				    if (e.keyCode == 9 ) {
				        return false;
				    }
				    if (e.keyCode == 32 && !spaceAllowed) {
				        return false;
				    }
				});
				//customcursor($('.pointer'),'http://localhost:8888/acom/images/cursor48.png');
				

				
			});
			

