$('document').ready(function(){	
	ote.Setup.setTemplateID(20);

	/** Load the extensions for the my account page **/
	if(ote.Router.getAlias() == 'MyProfile'){
		$.getScript('/scripts/inputEdit.jquery.js', function(){		
			$.getScript('/scripts/myAccount.jquery.js');		
			$('.inputEditable').editable({callback: 'myAccount.saveDetails(element)', switchLabel: 'save', cancelLabel: 'cancel'});
		});
	}
	
	$('.addressHandler').groupEdit({classHandler: 'addressGroup', callback: 'myAccount.saveDetails(element)', switchLabel: 'save', cancelLabel: 'cancel', validateUsps: true});
	
	$.getScript('/scripts/menudown.jquery.js', function(){		
		$('#listTopMenuRoot').menudown({
			activeClass: 'open',   
	        submenuSelector: 'ul', 
	        show: {height: 'show'},
	        showSpeed: 300,         
	        showDelay: 20,          
	        hide: {opacity: 'hide'},
	        hideSpeed: 200,         
	        hideDelay: 80,         
	        fixIE: true     
		});
	});
	$.getScript('/scripts/imagePreload.jquery.js', function(){		
		$('.menuItem').imageSwap();
		$('.imageSwap').imageSwap({mode: 'imagepath', mutatorOn: 'off', mutatorOff: 'on', separator: '_'});
	});
	
	$(document).pngFix();
	items = new Array;
	items[0] = 'page';
	items[1] = 'body';
	$(document).pngFix({exclude: items}); 
	
	if($('#frameContainer').length > 0){
		var els = new Array;		
		els[0] = 'topnav';
		els[1] = 'footer';		
		layout.setDynamicHeight('#frameContainer', els, 50);	
	}
	
	if ( $('#column-right').height() > $('.document-main-content').height() ) {		
		$('.document-main-content').height( $('#column-right').height() + parseInt( $('#column-right').css( 'margin-top' ) ) );
	}
});