var windowWidth;
var windowHeight;
var origWidth;
var origHeight;
var xcenter;
var ycenter;
var prefix;
var suffix;
var leftRef;
var topRef;
var is;
var leftmost;
var topmost;


// object browserCheck();


function browserCheck() {
	// this is the new stuff
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera5=this.agent.indexOf("Opera 5")>-1;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.ns=this.ns4||this.ns6;
	this.is=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5);        

	// this is from the old stuff
	this.ns61 = (this.b=="ns" && (navigator.userAgent.indexOf('6.1')>0))
	this.min = (this.v>=4);
	var plat = navigator.platform;
	if (plat == "Win32") this.win = true;
	if (plat == "MacPPC") this.mac = true;

	return this;
}

// FUNCTIONS BEGIN HERE

// setup()
// position()
// getX()
// setX()
// getY()
// setY()
// getZ()
// setZ()
// swapZ()
// show()
// hide()
// getWidth()
// getHeight()
// clip()
// changeImage()
// getImgX()

// void getDimensions();

function setup() {
	topmost=0;
	if (is.ns4) {
		windowWidth=window.innerWidth;
		windowHeight=window.innerHeight;
		prefix = 'document.';
		suffix = '';
		leftRef = ".pageX";
		topRef = ".pageY";
	} else if (is.ns6) {
		windowWidth=window.innerWidth;
		windowHeight=window.innerHeight;
		prefix = 'document.getElementById("';
		suffix = '").style';
		leftRef = ".left";
		topRef = ".top";
		topmost=-3;
	} else if (is.ie4) {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
    	prefix = 'document.all.';
    	suffix = '.style';
		leftRef = ".pixelLeft";
		topRef = ".pixelTop";
	} else {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
		prefix = 'document.getElementById("';
    	suffix = '").style';
		leftRef = ".left";
		topRef = ".top";
		
	}
	leftmost = (windowWidth-840)/2;
	if (leftmost<0) {
		leftmost = 0;
	}
}

// void position(string id, int x, int y);
function position(id, x, y){
	setX(id, x);
	setY(id, y);
}

// int getX(string id);
function getX(id){
	eval("x = "+prefix+id+suffix+leftRef);
	return parseInt(x);
}

// void setX(string id, int x);
function setX(id, x){
	eval (prefix+id+suffix+leftRef+" = "+x);
}

// int getY(string id);
function getY(id){
	eval("y = "+prefix+id+suffix+topRef);
	return parseInt(y);
}

// void setY(string id, int y);
function setY(id, y){
	//alert(id + " " + y);
	eval (prefix+id+suffix+topRef+" = "+y);
}

// int getZ(string id);
function getZ(id){
	eval ("zindex = "+prefix+id+suffix+".zIndex");
	return zindex;
}

// void setZ(string id, int zindex);
function setZ(id, zindex){
	eval (prefix+id+suffix+".zIndex = "+zindex);
}

// void swapZ(string id1, string id2);
function swapZ(id1, id2){
}

// void show(string id);
function show(id){
	eval(prefix+id+suffix+'.visibility = "visible"');
}

// void hide(string id);
function hide(id){
	eval(prefix+id+suffix+'.visibility = "hidden"');
}

// string getVisibility(string id)
function getVisibility(id){
	eval("visibility = "+prefix+id+suffix+".visibility");
	if (visibility == "show"){
		visibility = "visible";
	}
	if (visibility == "hide"){
		visibility = "hidden";
	}
	return visibility;
}

// int getWidth(string id);
function getWidth(id){
	if (is.ns4){
		width = document.layers[id].clip.width;
		}
	else if (is.ns6 || is.ie6) { 
		width = document.getElementById(id).offsetWidth;
	} 
	else{
		width = document.all[id].offsetWidth;
		}
	return width;
}

// int getHeight(string id);
function getHeight(id){
	if (is.ns4) {
		eval ("height = document.layers."+id+".clip.height");
	} 
	else if (is.ns6) { 
		height = document.getElementById(id).offsetHeight;
	} 
	else {
		eval ("height = "+id+".offsetHeight");
	}
	return height;
}

function setHeight(id, height) {
	eval(prefix+id+suffix+'.height = '+height);
}

// void clip(string id, int top, int right, int bottom, int left);
function clip(id, top, right, bottom, left){
	if (is.ie || is.ns6) {
		eval(prefix+id+suffix+".clip = 'rect("+top+"px "+right+"px "+bottom+"px "+left+"px)'");
	} 
	else { // ns4
		eval (prefix+id+suffix+".clip.top = "+top);
		eval (prefix+id+suffix+".clip.bottom = "+bottom);
		eval (prefix+id+suffix+".clip.right = "+right);
		eval (prefix+id+suffix+".clip.left = "+left);
	}
}

// void changeImage(string id, string imgname, string imgobj);
function changeImage(id, imgname, imgobj){
	if (is.ns4){
		eval ("document.layers."+id+".document."+imgname+".src = "+imgobj+".src");
	} else if (is.ie6) {
		eval ("document.getElementById('"+imgname+"').src = "+imgobj+".src");
	} else if (is.ie) {
		eval ("document.all."+imgname+".src = "+imgobj+".src");
	} else {
		eval ("document."+imgname+".src = "+imgobj+".src");
	}
}


function setImgHeight(imgname,parentlayer,num) {
	if (is.ns4) return;
	else eval('document.images["'+imgname+'"].height = '+num);
}


function PlaySound(url) {
document.all.sound.src = url;
}

var aySound = new Array();
// Below: source for sound files to be preloaded
aySound[0] = "http://momentum.aderant.com/assets/media/jungle.wav";

// DO NOT edit below this line
document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;

function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }

function mailpage()
{
//mail_str = "mailto:?subject=Momentum 2008 Session List " + document.title;
mail_str = "mailto:?subject=Momentum 2011 Orlando May 9-12";
//mail_str += "&body=I thought you might be interested in the " + document.title;
mail_str += "&body=I thought you might be interested in the Momentum 2011 Session List. Visit momentum.aderant.com for more information";
mail_str += ". You can view it at, " + location.href; 
location.href = mail_str;
}
function mailpageapa()
{
mail_str = "mailto:?subject=APA Momentum 2008 Sydney";
//mail_str += "&body=I thought you might be interested in the " + document.title;
mail_str += "&body=I thought you might be interested in the Momentum 2008 Session List";
mail_str += ". You can view it at, " + location.href; 
location.href = mail_str;
}
/*function printpr()
{
var OLECMDID = 7;
 OLECMDID values:
* 6 - print
* 7 - print preview
* 1 - open window
* 4 - Save As


var PROMPT = 1; // 2 DONTPROMPTUSER
var WebBrowser1 = "<OBJECT ID='WebBrowser1' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></OBJECT>";
document.body.insertAdjacentHTML("beforeEnd", WebBrowser1);

WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML = "";
}
*/
function CheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
}

function UnCheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = false ;
}
var bgcolor = "#ffffff";
var change_color = "#e5e5e5"
function mover(aa) {
 aa.style.backgroundColor = change_color;
}
function mout(aa) {
 aa.style.backgroundColor = bgcolor;
}



