<!-- Email js functions by PluginLab -->
function EchkForm()
{
  var o, sErrMsg="";
  o = fo('EName');
  if (o.value == "") {
	sErrMsg+="* Username is a required field.\n";
  }
  o = fo('EEmail');
  if (!isEmailValid(o.value)) {
	sErrMsg+="* Enter your valid email address.\n";
  }
  o = fo('EBDescr');
  if (o.value == "") {
	sErrMsg+="* Description is a required field.\n";
  }
  var bOK = (sErrMsg=="");
  if (!bOK) alert(sErrMsg);
  return bOK;
}

function fo(id){return document.getElementById(id)}
function setScrBarColors(line, face) {
return; // let's get rid of this for now...
  if (!isIE) return;
  with (document.body.style) {
	scrollbarDarkShadowColor=line;
	scrollbar3dLightColor=line;
	scrollbarBaseColor=face;
	scrollbarFaceColor=face;
	scrollbarHighlightColor=face;
	scrollbarShadowColor=face;
  }
}

function isEmailValid(em)
{
  var p1=em.indexOf('@'), p2=em.lastIndexOf('.'), l=em.length; 
  return (p1 > 0) && (p2 > p1+1) && (p2 < l-1); 
}
<!-- End of email js functions -->

<!-- Javascript document.write to div -->
var gallerydisplaybox = new NewDiv(window, "div1"); //div1 can be arbitrary
var gallerycommentbox = new NewDiv(window, "div2");

isNS = document.layers?true:false;
isIE = navigator.appName.indexOf("Microsoft") != -1
isNS6 = !isIE && document.getElementById?true:false;

function NewDiv(window, id, body) {
    this.window = window;
    this.id     = id;
    this.body   = body;
    var d = window.document;
    d.writeln('<STYLE TYPE="text/css">#' + id + ' {');
    d.writeln('}</STYLE>');
}
if (isNS) {
    NewDiv.prototype.output = function() { var d = this.window.document;d.writeln('<DIV ID="' + this.id + '">');d.writeln(this.body);d.writeln("</DIV>");this.layer = d[this.id];}
    NewDiv.prototype.setBody = function() { for(var i = 0; i < arguments.length; i++) this.layer.document.writeln(arguments[i]);this.layer.document.close();}}

if (isIE) {
    NewDiv.prototype.output = function() { var d = this.window.document;d.writeln('<DIV ID="' + this.id + '">');d.writeln(this.body);d.writeln("</DIV>");this.element = d.all[this.id];this.style = this.element.style;}
    NewDiv.prototype.setBody = function() { var body = "";for(var i = 0; i < arguments.length; i++) {body += arguments[i] + "\n";}this.element.innerHTML = body;}
}

if (isNS6) {
    NewDiv.prototype.output = function() { var d = this.window.document;d.writeln('<DIV ID="' + this.id + '">');d.writeln(this.body);d.writeln("</DIV>");this.element = d.getElementById(this.id);this.style = this.element.style;}
    NewDiv.prototype.setBody = function() { var body = "";for(var i = 0; i < arguments.length; i++) {body += arguments[i] + "\n";}this.element.innerHTML = body;}
}
<!-- End javascript document.write to div -->

function ObjVisibility(id, visibility) {
	var obj=document.getElementById(id);
	obj.style.visibility = visibility;
	return
}

function ObjDisplay(id, display) {
	var obj=document.getElementById(id);
	obj.style.display = display;
	return
}

function SetImgSrc(id, image) {
	var obj=document.getElementById(id);
	obj.src = image;
	GalleryDisplayImage();
	return
}

function GalleryDisplayImage() {
	ObjVisibility('galleryquicktime', 'hidden');
	ObjVisibility('gallery-displaybox', 'visible');
	return
}

function GalleryDisplayQuicktime() {
	ObjVisibility('gallery-displaybox', 'hidden');
	ObjVisibility('galleryquicktime', 'visible');
	return
}

function swapMovie(movieName) {
	GalleryDisplayQuicktime()
	document.movie.SetResetPropertiesOnReload(false);
	document.movie.SetURL('../files/'+movieName+'.mov');
	return
}

function GallerySrcImage(image) {
	gallerydisplaybox.setBody('<img id="gallery-displayimage" src="'+image+'" alt="" title="" />');
	return
}

function GallerySrcMovie(mov) {
	gallerydisplaybox.setBody('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="260" height="330"><param name="src" value="'+mov+'" /><param name="controller" value="false" /><param name="autoplay" value="true" /><param name="loop" value="true" /><object type="video/quicktime" data="'+mov+'" width="260" height="330" class="mov"><param name="controller" value="false" /><param name="autoplay" value="true" /><param name="loop" value="true" />Error text.</object></object>');
	return
}

function GallerySetComment(txt) {
	gallerycommentbox.setBody(txt);
	return
}

