jQuery(document).ready(function(){// < Input Placeholder	jQuery('input[type=text]:not(".un-placeholder"),textarea:not(".un-placeholder"),.text-input:not(".un-placeholder"),textarea:not(".un-placeholder")').addClass('placeholder').each(function(){		jQuery(this).attr('defaultValue',jQuery(this).val());	});	jQuery('input[type=text],textarea,.text-input').focus(function(){		if(jQuery(this).hasClass('placeholder') && jQuery(this).val() == jQuery(this).attr('defaultValue')){			jQuery(this).val('');		}	});	jQuery('input[type=text],textarea,.text-input').focus(function(){		jQuery(this).removeClass('placeholder');	});	jQuery('input[type=text],textarea,.text-input').blur(function(){		if(jQuery(this).val() == ''){			jQuery(this).val(jQuery(this).attr('defaultValue'));			jQuery(this).addClass('placeholder');		}	});// Input Placeholder >// < IE Drop Down Support	jQuery('#side-nav li').hover(function(){		jQuery(this).addClass('sfhover');	},function(){		jQuery(this).removeClass('sfhover');	});// IE Drop Down Support >// < Grab Referrer Info for Salesforce Web 2 Lead Form	jQuery('.w2llead textarea').val('Form: "'+jQuery('.hentry h1 a').text()+'"').hide().prev().prev().hide();// Grab Referrer Info for Salesforce Web 2 Lead Form >// < Merge Job Listing & Resume Submission additional info into a single, salesforce-friendly, input	jobListingFields = jQuery('input[name="lead_source"],#submission-position,#submission-number,#submission-hours,#submission-requirements,#swfupload-url');	function mergeJobListingFields(){		mergedVal = '';		jobListingFields.each(function(){			mergedVal+= jQuery(this).attr('name')+': '+jQuery(this).val()+' ||| ';		});		jQuery('#submission-description').val(mergedVal);	}	jobListingFields.keyup(function(){mergeJobListingFields();});	setInterval(function(){mergeJobListingFields();},1000);// Merge Job Listing info into a single, salesforce-friendly, input >/* // < Contact arrow animation	jQuery('#request-info-label').css('background-position','8px 0px');	jQuery('#request-info-form,#request-info-label').hover(		function(){			jQuery('#request-info-label').stop().animate({				backgroundPosition:'(8px 30px)'			},1000);		},function(){			jQuery('#request-info-label').stop().animate({				backgroundPosition:'(8px 30px)'			},200,'linear',function(){				jQuery('#request-info-label').css('background-position','8px -30px');				jQuery('#request-info-label').animate({					backgroundPosition:'(8px 0px)'				},600);			});		}	);// Contact arrow animation > */// Start enable form validation	jQuery('form').validationEngine({		inlineValidation: true,		success :  false,		failure : function() {peekaboo_popups();}	});// End enable form validation// Start fade form tooltips on hover	function peekaboo_popups(){		jQuery('.formError').hover(			function(){				jQuery(this).stop().fadeTo('fast',0.1);			},function(){				jQuery(this).stop().fadeTo('slow',1);			}		);		jQuery('.formError').click(			function(){				jQuery(this).remove();			}		);	}// End fade form tooltips on hover// Start tooltips	jQuery('.has-tooltip').tooltip({ offset: [10, 0], position: ['top', 'center']});	jQuery('#social-icons a').tooltip({ offset: [4, 26], position: ['bottom', 'left']});// End tooltips// Start sticky sidebar	if(jQuery('#home').length != 1 && jQuery.browser.msie != true){ // Make sure it's not on the homepage or using Internet Explorer		jQuery(window).scroll(function(){			if(jQuery(window).height() > jQuery('#aside').height()+100 && jQuery(window).scrollTop() > 160){ // Check if window is taller than the sidebar + some safety room & check if window is scrolled far enough				jQuery('#aside').css({'position':'fixed','top':'36px','right':'50%','marginRight':'-495px'}); // Stick sidebar				jQuery('.top-of-page').fadeIn('fast'); // Show "Scroll to top of page"			}else{				jQuery('#aside').removeAttr('style'); // Un-Stick sidebar				jQuery('.top-of-page').fadeOut('fast'); // Hide "Scroll to top of page"			}		});	}// End sticky sidebar// Start scroll to top	jQuery('.top-of-page').click(function(){		jQuery('html, body').animate({scrollTop:0}, 'slow'); // Animate scroll		return false; // Prevent jumping to the top	});// End scroll to top// Start jQuery swfupload (used in shortcode forms)jQuery(function(){	jQuery('#swfupload').swfupload({		upload_url: "/upload/upload-file.php",		file_post_name: 'uploadfile',		file_size_limit : "3000000000000",		file_types : "*.jpg;*.jpeg;*.gif;*.png;*.pdf;*.swf;*.fla;*.doc;*.docx;*.pages;*.key;*.numbers;*.txt;*.rtf;*.xls;*.xlsx;*.ppt;*.pptx;*.mov;*.mp4;*.avi;*.ai;*.psd;*.zip;*.rar",		file_types_description : "Misc files",		file_upload_limit : 1,		flash_url : "/upload/swfupload/swfupload.swf",		button_image_url : '/upload/swfupload/wdp_buttons_upload_114x29.png',		button_width : 114,		button_height : 29,		button_placeholder : jQuery('#swfupload-button')[0],		debug: false	})	.bind('fileQueued', function(event, file){		var listitem='<li id="'+file.id+'" >'+			'<span class="progressvalue" ></span> of '+Math.round(file.size/1024)+' KB'+			'<div class="progressbar" ><div class="progress" ></div></div>'+			'</li>';		jQuery('#swfupload-log').append(listitem);		// start the upload since it's queued		jQuery(this).swfupload('startUpload');	})	.bind('fileQueueError', function(event, file, errorCode, message){		alert('Size of the file '+file.name+' is greater than limit');	})	.bind('uploadStart', function(event, file){		jQuery('#swfupload-log li#'+file.id).find('span.progressvalue').text('0%');		jQuery('input[type="submit"]').addClass('disabled').attr('disabled','disabled');	})	.bind('uploadProgress', function(event, file, bytesLoaded){		//Show Progress		var percentage=Math.round((bytesLoaded/file.size)*100);		jQuery('#swfupload-log li#'+file.id).find('div.progress').css('width', percentage+'%');		jQuery('#swfupload-log li#'+file.id).find('span.progressvalue').text(percentage+'%');	})	.bind('uploadSuccess', function(event, file, serverData){		var item=jQuery('#swfupload-log li#'+file.id);		item.find('div.progress').css('width', '100%');		item.find('span.progressvalue').text('100%');		fileURL = serverData.replace('./files/','http://www.skywalkgroup.com/upload/files/');		jQuery('#swfupload-url').val(fileURL);		setTimeout(function(){jQuery('input[type="submit"]').removeClass('disabled').removeAttr('disabled');item.addClass('success');},1000);	})	.bind('uploadComplete', function(event, file){		// upload has completed, try the next one in the queue		jQuery(this).swfupload('startUpload');	});});// End jQuery swfupload});
