jQuery(document).ready(function(){			

jQuery("span.menuwrap").append("<img class='leftcap cap' src='/Portals/_default/skins/customSite/images/menu/leftcap.png' /><img class='rightcap cap' src='/Portals/_default/skins/customSite/images/menu/rightcap.png' />");


jQuery("a.subrollover").prepend("<span class='leftcap cap'></span><span class='rightcap cap'></span>");


jQuery("#innermenu div.abscontainer:first").addClass("first");	
  jQuery("a.active").click(function(){return(false);});	
  jQuery("div.sub").hide();	
  jQuery("div.sub").each(function(){
								  jQuery(this).children("a:last").addClass("sublast");
								  jQuery(this).children("a:first").addClass("subfirst");			
								  });
 
 //open active sub
 //jQuery("#menu a.activepage").parent().stop().slideDown("slow");



jQuery("a.active").click(function(){
					jQuery("div.active").stop().slideUp("slow").prev("span.paddy").stop().css("height", "8px").slideDown("slow");
					jQuery("div.active:eq("+ jQuery("a.active").index(this) + ")").stop().css("height", "auto").slideDown("slow").prev("span.paddy").stop().slideUp("slow");
				
								
 	});
jQuery("#dnn_ContentPane, #sidebar").mouseover(function(){
					jQuery("div.active").stop().slideUp("slow").prev("span.paddy").stop().css("height", "8px").slideDown("slow");;
								
 	}); 

/*flashing
jQuery("div.active a").mouseover( function(){jQuery(this).stop().fadeTo("fast", 0.6, function(){jQuery(this).fadeTo("slow", 1);});});*/

 });


function runSiteScripts(path) {
	
// gets rid of focus box on click
	if(document.getElementsByTagName) {
	var a = document.getElementsByTagName("a");
	//collect all anchors A
		for(var i = 0; i < a.length; i++){
		// mouse onfocus, blur anchors
		a[i].onfocus = function(){this.blur();};
		}
	}

}



//var a = 0;
function loaded() {
	var myScroll;
	//setHeight();	// Set the wrapper height. Not strictly needed, see setHeight() function below.
	// Please note that the following is the only line needed by iScroll to work. Everything else here is to make this demo fancier.
	myScroll = new iScroll('scrollerpadder', {desktopCompatibility:true});
}

// Change wrapper height based on device orientation. Not strictly needed by iScroll, you may also use pure CSS techniques.
function setHeight() {
	var headerH = document.getElementById('header').offsetHeight,
		footerH = document.getElementById('footer').offsetHeight,
		wrapperH = window.innerHeight - headerH - footerH;
	document.getElementById('scrollerarea').style.height = wrapperH + 'px';
}

// Check screen size on orientation change
//window.addEventListener('onorientationchange' in window ? 'orientationchange' : 'resize', setHeight, false);

// Prevent the whole screen to scroll when dragging elements outside of the scroller (ie:header/footer).
// If you want to use iScroll in a portion of the screen and still be able to use the native scrolling, do *not* preventDefault on touchmove.
//document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

// Load iScroll when DOM content is ready.
document.addEventListener('DOMContentLoaded', loaded, false);



