$(document).ready(function() {
	/* Highslide */
	hs.registerOverlay({ overlayId:'closebutton', position:'top right', fade:2 });
	
	// #nav
	// sfHover()
});

/* ----------------------
   Scripts
---------------------- */

function sfHover() {
	if (document.all&&document.getElementById) {
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" over";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" over\\b"), "");
			}
		}
	}
}

/* Popup:
popup(URL, Width, Height, Left, Top, AutoCenter[0=False, 1=True], FullScreen[0=False, 1=True])
<a href="javascript:popUp('domain', 640, 480, 50, 50, 1, 0)">Popup!</a>
*/
function popup(URL, popWidth, popHeight, popLeft, popTop, autoCenter, fullScreen) {
	day = new Date();
	id = day.getTime();
	if ( autoCenter == 1 ) {
		var popLeft = (screen.width - popWidth) / 2;
		var popTop = (screen.height - popHeight) / 2;
	}
	if ( fullScreen == 1 ) {
		// Open in Full Screen window!
		eval("page"+id+" = window.open(URL, '"+id+"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+(screen.width-10)+",height="+(screen.height-26)+",left=0,top=0');");
	} else {
		// Open in normal window!
		eval("page"+id+" = window.open(URL, '"+id+"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+popWidth+",height="+popHeight+",left="+popLeft+",top="+popTop+"');");
	}
}





/* STANDARD SCRIPTS FROM EDITOR (cut/splice) */

/* Preload Images */
function preloadimages() {
	var i = 0;
	var myimg = new Array();
  for ( i=0; i<preloadimages.arguments.length; i++ ) {
    myimg[i] = new Image();
    myimg[i].src = preloadimages.arguments[i];
  }
}
preloadimages(
	"presentation/delete_hover.gif",
	"presentation/edit_hover.gif",
	"presentation/preview_hover.gif",
	"presentation/copy_hover.gif"
);


/* Toggle Content Text */
function expandText(location, image) {
	var para = document.getElementById(location);
	var gif = document.getElementById(image);
	if ( para.style.display == "inline" ) {
		para.style.display = "none";
		gif.src = "presentation/folder_closed.gif";
	} else {
		para.style.display = "inline";
		gif.src = "presentation/folder_open.gif";
	}
}

/* Toggle Content */
function expand(location) {
	var para = document.getElementById(location);
	if ( para.style.display == "inline" ) {
		para.style.display = "none";
	} else {
		para.style.display = "inline";
	}
}


/* Copy Content */
function copy(stoput) {
	var flashcopier = 'flashcopier';
	if(!document.getElementById(flashcopier)) {
		var divholder = document.createElement('div');
		divholder.id = flashcopier;
		document.body.appendChild(divholder);
	}
	document.getElementById(flashcopier).innerHTML = '';
	var divinfo = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' +
	'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ' +
	'width="0" height="0">' +
	'<param name="src" value="behaviour/_clipboard.swf?clipboard='+encodeURIComponent(stoput) + '" />' +
	'<embed src="behaviour/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(stoput)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>' +
	'</object>'
	document.getElementById(flashcopier).innerHTML = divinfo;
}

/*
function copy(inElement) {
  if (inElement.createTextRange) {
    var range = inElement.createTextRange();
    if (range && BodyLoaded==1)
     range.execCommand('Copy');
  } else {
    var flashcopier = 'flashcopier';
    if(!document.getElementById(flashcopier)) {
      var divholder = document.createElement('div');
      divholder.id = flashcopier;
      document.body.appendChild(divholder);
    }
    document.getElementById(flashcopier).innerHTML = '';
    var divinfo = '<embed src="behaviour/_clipboard.swf" FlashVars="clipboard='+escape(inElement.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    document.getElementById(flashcopier).innerHTML = divinfo;
  }
}*/