/*/=====================================================================
	Start Javascript Functions
========================================================================/*/
/*/ Get the full path to the siteSkin folder /*/
var VirtualPath = location.href.substring(0,location.href.lastIndexOf('.com')+4 )
var DNN_skinPath = '/Portals/_default/Skins/siteSkin/'
var fullSkinPath = VirtualPath + DNN_skinPath
//alert(fullSkinPath)


/*/ 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';
	}
//alert(eraseList.length);
}
/*Put this towards footer
and list items like an array*/
//removeElementsById("homePhoto,pagePhoto");



/*/=====================================================================
	Start jQuery Functions
========================================================================/*/
jQuery(document).ready(function(){

	jQuery.fn.outerHTML = function() {
		 return jQuery('<div>').append(this.eq(0).clone()).html();
	};

	jQuery.fn.replaceWith = function() {
		 var stack = [];
		 return this.domManip(arguments, true, 1, function(a){
			  this.parentNode.replaceChild( a, this );
			  stack.push(a);
		 }).pushStack( stack );
	};

	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(){}
	})
	
	.find('#nav>ul>li:has(ul)') //fixes ie6 bug
		.mouseover(function(){jQuery('ul', this).bgIframe({opacity:true});})
		.find('a').focus(function(){jQuery('ul', jQuery('#nav>ul>li:has(ul)')).bgIframe({opacity:true});});

	/*/ center a horizontal menu /*/
	jQuery(function(){
		var navWidth =  jQuery("div#nav>ul").outerWidth();
		var menuWidth = navWidth + 20;
		var centerMargin = (1000 - menuWidth)/2;
		jQuery("div#nav>ul").css({width:menuWidth, left:centerMargin});
	});

	/*/ Add dots to menu /*/
	jQuery('#nav>ul>li>a:last').css('backgroundImage','none');
	
	/*/ Add Titles to All Links /*/
	jQuery('a').each(function() {
		var title = jQuery(this).text();
		jQuery(this).attr('title', title);
	});
	
	/*/ Remove Box from Links /*/
	jQuery('a').focus(function(){this.blur();});
	
	
	/*/ Add dropShadows to anything /*/
	// Selection may require bgcolor set like:
	//jQuery('.shadowThis').find('img').css('background','black');
	jQuery('.pagePhoto').dropShadow({
		left:-1,
		top:1,
		blur:2,
		opacity:0.6,
		color:'#000',
		swap:false
	});
	
});
