function viewimage(viewer_type,parm_string,w,h,parent_type,parent_id) {
popUpWindow=window.open('/utility/image_viewer.asp?image_type=' + viewer_type + '&w=' + w +'&h='+ h + '&' + parm_string + '&parent_type=' + parent_type + '&parent_id=' + parent_id ,'w','width='+w+',height='+h+',scrollbars=no,toolbars=no,resizable=no,menubar=no,status=no');
popUpWindow.focus();
}

function openBrWindow(theURL) { 
window.open(theURL,'w','scrollbars=no,toolbars=no,resizable=no,menubar=no,status=no');
}


// FOR IE FLICKER BUG
if (document.all) {
try {document.execCommand("BackgroundImageCache", false, true);} 
catch(err) {}
}


// EMBEDS FLASH
var getIt = 'You need Flash (version 8+) to view this... please download it <a href="http://www.adobe.com/go/getflashplayer" target="_blank">here</a>.<br />'

function embedFlash (url,w,h) {
document.write('<object type="application/x-shockwave-flash" data="'+url+'" width="'+w+'" height="'+h+'" menu="false">');
document.write('<param name="movie" value="'+url+'">');
document.write('<param name="menu" value="false">');
document.write(getIt);
document.write('<\/object>');
}


// EMBEDS A YOUTUBE MODULE
function embedYouTube (url) {
document.write('<object type="application/x-shockwave-flash" data="'+url+'" width="209" height="177" menu="false" wmode="transparent">');
document.write('<param name="movie" value="'+url+'">');
document.write('<param name="menu" value="false">');
document.write('<param name="wmode" value="transparent">');
document.write(getIt);
document.write('<\/object>');
}


// EMBEDS AN UPLOADED FLV
function embedVideo (url) {
document.write('<object type="application/x-shockwave-flash" data="/params/video/player.swf?video='+url+'" width="209" height="177" menu="false" wmode="transparent">');
document.write('<param name="movie" value="/params/video/player.swf?video='+url+'">');
document.write('<param name="menu" value="false">');
document.write('<param name="wmode" value="transparent">');
document.write(getIt);
document.write('<\/object>');
}

//RESIZE IFRAME ONLOAD
function resizeIframe(x){
var theIframe = document.getElementById(x)
var theIframeHeight = Math.max(theIframe.contentWindow.document.body.scrollHeight, theIframe.contentWindow.document.documentElement.scrollHeight);
theIframe.style.height = theIframeHeight+"px"
theIframe.contentWindow.document.getElementById('iframe_content').style.visibility = "visible"
}


// TOGGLE BEWTEEN CONTENT
function showContent(x){

var theItem = x.parentNode
var theList = theItem.parentNode.childNodes
var i = theList.length-1

do {if (theList[i].tagName!=null){theList[i].className = "";}}
while (i--)

theItem.className = "on"

}

function setHomePage () {

var theBody = document.getElementsByTagName("BODY")[0]
var theRhs = document.getElementById("rhs")

if (document.getElementsByTagName("h1").length>0 && theRhs!=null) {

if (theBody.id!="home") {
theRhs.style.position = "relative"
theRhs.style.top = "-48px"
}

}

if (theBody.id=="home") {

var theDivs = document.getElementById('middle').getElementsByTagName("DIV")
var maxHeight = 0
var divsArray = []
var hasBanner = theDivs[0].className.indexOf("banner")>0?3:0

for (i=hasBanner; i<theDivs.length; i++) { 

if (theDivs[i].className.indexOf("inner")==0){

	divsArray.push(theDivs[i])

	if (theDivs[i].offsetHeight > maxHeight){
		maxHeight=theDivs[i].offsetHeight}

}

}

for (i=0; i<divsArray.length; i++) { 
divsArray[i].style.height = maxHeight + "px";
}

if (divsArray[2]!=null){divsArray[2].parentNode.parentNode.style.marginRight = "0px";}
document.getElementById('middle').style.visibility = 'visible'
}

if (theRhs!=null) {

var rhsDivs = theRhs.getElementsByTagName("DIV")

for (i=0; i<rhsDivs.length; i++) { 

if (rhsDivs[i].className.indexOf("navigation")>0 || rhsDivs[i].className.indexOf("grey_profile")>0) {
	var x = document.createElement("div");
	x.className = "ftr"
	rhsDivs[i+2].appendChild(x) 
	//break
	}
	}
}
}
