function MenuOver(catId, color) {
	document.getElementById("blockTopMenu" + catId).className = "blockTopMenuOver" + color;
	document.getElementById("linkTopMenu" + catId).className = "linkTopMenuOver" + color;
	
	document.getElementById("menuHref" + catId).className = "linkTopMenuOver" + color;
}

function MenuOut(catId, color) {
	document.getElementById("blockTopMenu" + catId).className = "blockTopMenu" + color;
	document.getElementById("linkTopMenu" + catId).className = "linkTopMenu" + color;
	
	document.getElementById("menuHref" + catId).className = "linkTopMenu" + color;
}

function changeStyle(elementId, styleName) {
	document.getElementById(elementId).className = styleName;
}


function loadPage() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
   //Non-IE
   myWidth = window.innerWidth;
   myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
	    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
	    myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
  }
  document.getElementById("blockMain").style.top = ( myHeight - 435 ) / 2  + "px";
  document.getElementById("blockMain").style.visibility = "visible";
}

function swapPhoto(name, source){
	var imageObj = document.getElementById('imageGalleryBigItem');
	imageObj.alt = name;
	imageObj.src = source;
	return false;
}

function changeJob() {
	if ( document.getElementById("jobId").value == 0 ) {
		document.getElementById("blockJobOther").style.display = "inline";
		document.getElementById("feed_job").focus();
	} else {
		document.getElementById("blockJobOther").style.display = "none";
		document.getElementById("feed_name").focus();
	}
}

function showVideo(fileTable, fileId) {
	prew=window.open("./?category=video&id="+fileId+"&table="+fileTable, "prew", "toolbar=no,menubar=no,status=no,location=no,scrollbars=no,resizable=no,statusbar=no, width=412, height=385");
	if (!prew.focus) prew.focus;
	return false;
}



// custom scroll application developed for three.oh 3/2001.
// thanks to brandon (www.jesterworld.net) and grant (no site cuz he's too pimp for it) for the help w/ the visuals.

// optimized for the latest version of {3.0} by bob

ThreeOhScroll.mo5 = navigator.userAgent.indexOf("Gecko") != -1
ThreeOhScroll.ie4 = navigator.appName == "Microsoft Internet Explorer" && document.all
ThreeOhScroll.ie5 = navigator.appName == "Microsoft Internet Explorer" && document.getElementById
ThreeOhScroll.pc = navigator.platform == "Win32"

// this number is for ie4 pc only - which cannot have the description box be of variable width (or atleast i can't figure out how to).
// you set the number of pixels that the desc tag will be permanently.
ThreeOhScroll.ie4pcDescWidth = 100

// i have no idea why this number is necessary, it just is. it is related to how far the scroller is from the top of the window
// in mozilla, but you will have to play with it to get it just right.
ThreeOhScroll.mozAdjust = ThreeOhScroll.mo5 ? 0 : 0

// this is how long it should take the scroller to animate when the user clicks a marker (in milliseconds)
ThreeOhScroll.aniLen = 250


function ThreeOhScroll(id, offset)
{
	if (ThreeOhScroll.mo5 || (ThreeOhScroll.ie4 && ThreeOhScroll.pc) || ThreeOhScroll.ie5) {
		this.id = id
		this.getMembers()

		if (ThreeOhScroll.ie4 && !ThreeOhScroll.ie5 && ThreeOhScroll.pc) this.description.style.width = ThreeOhScroll.ie4pcDescWidth

		this.clipH		= parseInt(this.container.style.height)
		var lastPTop	= this.content.offsetTop - ThreeOhScroll.mozAdjust
		this.docH		= lastPTop + Math.max(this.content.offsetHeight, this.clipH)
		this.scrollH	= this.docH - this.clipH
		this.thumbMax	= parseInt(this.thumbContainer.style.height) - this.thumbImg.height
		if (! this.scrollH){
      this.thumbContainer.style.display = 'none';
    }
		
		this.gRef = "ThreeOhScroll_"+id
		eval(this.gRef+"=this")
		this.thumb.obj	= this
		this.thumb.onmousedown = this.startDrag
		this.thumb.ondragstart = function() { return false }
		if (offset < this.scrollH){
      this.jumpTo(offset);
    }else{
      this.jumpTo(this.scrollH);
    }
		
	} else {
		alert ('');
	}
}

ThreeOhScroll.prototype.getMembers = function() {
	this.container = ypGetElementById('filterContainer');
	this.content = ypGetElementById('filterContent');
	this.thumb = ypGetElementById('filterThumb');
	this.thumbContainer = ypGetElementById('filterThumbContainer');
	this.thumbImg = ypGetElementById('filterThumbImg');
}

ThreeOhScroll.prototype.startDrag = function(e) {
	if (!e) e = window.event
	var ey = e.pageY ? e.pageY : e.clientY
	ey -= 9 + parseInt(this.obj.thumb.offsetHeight) + parseInt(document.getElementById("blockMain").style.top);
	this.dragLastY = ey
	this.dragStartOffset = ey - parseInt(this.style.top)
	ThreeOhScroll.current = this.obj
	document.onmousemove = this.obj.doDrag
	document.onmouseup = this.obj.stopDrag
	if (this.obj.aniTimer) window.clearInterval(this.obj.aniTimer)
	return false;
}

ThreeOhScroll.prototype.doDrag = function(e) {
	if (!e) e = window.event
	var obj = ThreeOhScroll.current
	var ey = (e.pageY ? e.pageY : e.clientY)
  ey -= 9 + parseInt(obj.thumb.offsetHeight) + parseInt(document.getElementById("blockMain").style.top);
	var dy = ey - obj.thumb.dragLastY
	var ny = parseInt(obj.thumb.style.top) + dy
	if (ny >= obj.thumbMax) obj.thumb.dragLastY = obj.thumbMax + obj.thumb.dragStartOffset
	else if (ny < 0) obj.thumb.dragLastY = obj.thumb.dragStartOffset
	else obj.thumb.dragLastY = ey
	ny = Math.min(Math.max(ny, 0), obj.thumbMax)
	obj.jumpTo(ny * obj.scrollH / obj.thumbMax)
	return false;
}

ThreeOhScroll.prototype.stopDrag = function() {
	this.onmousemove = null
	this.onmouseup   = null
}

ThreeOhScroll.prototype.scrollTo = function(ny) {
	this.startTime = (new Date()).getTime()
	this.startPos = parseInt(this.content.style.top) * -1
	this.endPos = ny
	this.dist = this.endPos - this.startPos
	this.accel = this.dist / ThreeOhScroll.aniLen / ThreeOhScroll.aniLen
	if (this.aniTimer) this.aniTimer = window.clearInterval(this.aniTimer)
	this.aniTimer = window.setInterval(this.gRef + ".scroll()", 10)
}

ThreeOhScroll.prototype.scroll = function() {
	var now = (new Date()).getTime()
	var elapsed = now - this.startTime
	if (elapsed > ThreeOhScroll.aniLen) this.endScroll()
	else {
		var t = ThreeOhScroll.aniLen - elapsed
		var ny = this.endPos - t * t * this.accel
		this.jumpTo(ny)
	}
}

ThreeOhScroll.prototype.endScroll = function() {
	this.jumpTo(this.endPos)
	this.aniTimer = window.clearInterval(this.aniTimer)
}

ThreeOhScroll.prototype.jumpTo = function(ny) {
	this.thumb.style.top	= Math.round(ny * this.thumbMax / this.scrollH) + 'px';
	this.content.style.top	= -ny + 'px';
}

function ypGetElementById(id) {
	return (document.getElementById ? document.getElementById(id) : document.all ? document.all[id] : false)
}

