/*/=====================================================================
	Start Javascript Functions
========================================================================/*/
/*/ Get the full path to the siteSkin folder /*/
var VirtualPath = location.href.substring(0,location.href.lastIndexOf('.com')+4 )
var fullSkinPath = VirtualPath + DNN_skinPath // DNN_skinPath var from Default.aspx page
//alert(fullSkinPath)

/*/ Get the page name /*/
var menuOrder = location.href.substring(location.href.lastIndexOf('.com')+5,location.href.lastIndexOf('/tabid'))
var pageName = menuOrder.substring(menuOrder.lastIndexOf('/')+1)
//alert(pageName)


/*/ Remove any elements by their id /*/
function removeElementsById(idArray){
	var eraseList = idArray.split(",");
	for (i=0;i<eraseList.length;i++) {
		document.getElementById(eraseList[i]).style.display = 'none';
	}
}
/*Put this towards footer and seperate items by comma */
//removeElementsById("homePhoto,pagePhoto");



/*/=====================================================================
	Start jQuery Functions
========================================================================/*/
jQuery(document).ready(function(){
	
	/*/ Accordion Navigation /*/
	// create an extra wrapper around the current menuSubs
	jQuery('.Level1').each(function(){
		var menuSub = jQuery(this).html(); // store the markup in a variable
		var anchorHead = jQuery(this).prev('a').html(); // store the markup in a variable		
		jQuery(this).parent('li').html('<div class="menuTitle"><a href="#">' + anchorHead + '</a></div><ul class="Level1">' + menuSub + '</ul>');
	});
	
	// Accordion
	jQuery('#nav>ul').accordion({
		active: false,
		header: '.menuTitle',
		event: 'click',
		alwaysOpen: false,
		autoheight:false,
		navigation:true,
		animated: 'slide',
		showSpeed: 400,
		hideSpeed: 800
	});
	
	/*/ Add Titles to All Links /*/
	jQuery('a').each(function() {
		var title = jQuery(this).text();
		jQuery(this).attr('title', title);
	});
	
	/*/ Add Menu Hover Class /*/
	jQuery('#nav>ul>li').hover(
		function(){jQuery(this).addClass('menuHover');},
		function(){jQuery(this).removeClass('menuHover');}
	);



	/*/ Remove Box from Links /*/
	jQuery('a').focus(function(){this.blur();});
	
	/*/ Hide That Ugly Version Number /*/
	jQuery('.ControlPanel a[id$=hypUpgrade]').css('display','none');

	/*/ Center the Captcha/Submit and Add Submit Class /*/
	jQuery('.formTable td[colspan=2]').css('text-align','center');
	jQuery('.formTable td[colspan=2]>a.CommandButton').removeClass('CommandButton').addClass('submitButton');

});
