/*/=====================================================================
	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(){
	
	/*/ SuperFish Navigation /*/
	// superFish
	jQuery('#nav>ul')
	.superfish({
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		delay		: 500,
		animation	: {opacity:'show',height:'show'},
		speed		: 'normal',
		oldJquery	: false, // set to true if using jQuery version below 1.2
		disableHI	: false, // set to true to disable hoverIntent detection
		onInit		: function(){},
		onBeforeShow	: function(){},
		onShow		: function(){},
		onHide		: function(){}
	})
	
	// fixes ie6 bug
	.find('#nav>ul>li:has(ul)')
		.mouseover(function(){jQuery('ul', this).bgIframe({opacity:true});})
		.find('a').focus(function(){jQuery('ul', jQuery('#nav>ul>li:has(ul)')).bgIframe({opacity:true});});
	
	/*/ Remove Box from Links /*/
	jQuery('a').focus(function(){this.blur();});
	
	/*/ Add Dynamic Backgrounds /*/
	jQuery('#nav>ul>li>a').each(function(i){
													 
		var menuArray = ['red', 'yellow', 'purple', 'pink' , 'orange'];
		jQuery(this).css({'background-image':'url("/Portals/_default/Skins/siteSkin/images/layout/menu_' + menuArray[i] + '.gif")'});
		
	});


	/*/ Add Titles to All Links /*/
	jQuery('a').each(function() {
		var title = jQuery(this).text();
		jQuery(this).attr('title', title);
	});
	
	/*/ 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');
	
});
