sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
		
function initRollovers() {
 if (!document.getElementById) return
 
 var aPreLoad = new Array();
 var sTempSrc;
 var aImages = document.getElementsByTagName('img');
 
 for (var i = 0; i < aImages.length; i++) {  
  if (aImages[i].className == 'imgover') {
   var src = aImages[i].getAttribute('src');
   var ftype = src.substring(src.lastIndexOf('.'), src.length);
   var hsrc = src.replace(ftype, '_o'+ftype);
 
   aImages[i].setAttribute('hsrc', hsrc);
   
   aPreLoad[i] = new Image();
   aPreLoad[i].src = hsrc;
   
   aImages[i].onmouseover = function() {
    sTempSrc = this.getAttribute('src');
    this.setAttribute('src', this.getAttribute('hsrc'));
   } 
   
   aImages[i].onmouseout = function() {
    if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
    this.setAttribute('src', sTempSrc);
   }
  }
 }
}

window.onload = initRollovers;


function openVideo(x){
	var video=window.open(x,'Ashland','width=550,height=522,location=no,scrollbars=no,toolbar=0,directories=0,status=0,menubar=0,resizable=no,screenx=0,screeny=0,top=0,left=0");video.focus();')
}

function openup(newpage, name) { 
	window.name = "main";
	switch (name){ 
	   case 'VIDEO' : 
		  win=window.open(newpage, name, "width=850, height=900, scrollbars=yes, resizable=yes, toolbar=no, status=no, location=no, menubar=no");  
		  break;
	   default : 
		  // Nothing happens if default; 
	} 
	if(win.focus){win.focus();}  // BRING TO FRONT
}

function loadIntoOpener(page) {
    if (opener && !opener.closed)
        opener.location=page;
    else {
		var myWin = window.open(page, '', "width=800, height=600, scrollbars=yes, resizable=yes, toolbar=yes, status=yes, location=yes, menubar=yes");
        //var myWin = window.open(page,'','width=100,height=100');
        // trick the window into thinking it was opened by this new window:
        opener = myWin;
    }
}

/// JANO FUNCTIONS/SCRIPTS HERE ////
var ssOpened = false; 
var thisPage = document.location.href;
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.dimmingOpacity = .6;

if (thisPage.indexOf("elogin=true")>0) {setTimeout("EmployeeLogin()",300)}

function DoNothing() {
}

function EmployeeLogin() {
	var elOpened = true;
	if (ssOpened) {
		if (thisPage.indexOf("elogin=true")<0) {
			if (thisPage.indexOf("?")<0) {
				document.location.href = thisPage + "?elogin=true";
			} else {
				document.location.href = thisPage + "&elogin=true";
			}
		} else {
			document.location.href = thisPage;
		}
	} else {
		hs.htmlExpand(null,{wrapperClassName:'borderless no-footer no-header',objectType:'iframe',width:400,height:250,src:'../login.asp',objectLoadTime:'before',preserveContent:false})
	}
}
function startSlides(show,id,nam,pic,cap) {
	var thisSrc = "./_images/portfolio/" + pic; 
	if (show) {
		hs.headingText = nam; hs.useBox = true; hs.width = 650; hs.height = 450; hs.slideshowGroup = id; 
		if (!ssOpened) { hs.addSlideshow({interval:5000,repeat:true,fixedControls:'fit',useControls:true,overlayOptions: {opacity:'0.75',position:'bottom right',offsetX:-22,offsetY:5},thumbstrip:{position: 'rightpanel',mode: 'float',relativeTo: 'expander',width:'170px'}});};
		hs.expand(null,{src:thisSrc,autoplay:true,captionText:cap,fadeInOut:true})
		ssOpened = true;
	}
}


