//Browser Detect

var detect = navigator.userAgent.toLowerCase();
var browser,thestring;

function getBrowser(){
if (checkIt('msie') || checkIt('internet explorer')) browser = "IE";
else if (!checkIt('compatible') || checkIt('firefox')){
	browser = "Mozilla";
	if(checkIt('firefox'))
		browser="Firefox";
	}
else browser = "Unknown";
return browser;
}

function checkIt(string){
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function addToq(rec){
	if(reqQ!=null){
	reqQ.push(rec);
	}
}


//Section to Move Object

function getImageXfromLeft(imgID) {
  if (getBrowser()!="IE"){
	  return document.getElementById(imgID).x;
	  }
  else {return getRealLeft(imgID);}
}

function getImageYfromTop(imgID) {
  if (getBrowser()!="IE") {
    return document.getElementById(imgID).y;
	}
  else {return getRealTop(imgID);}
}

function getRealLeft(imgElem) {
	xPos = document.getElementById(imgElem).offsetLeft;
	tempEl = document.getElementById(imgElem).offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	return xPos;
}

function getRealTop(imgElem) {
	yPos = document.getElementById(imgElem).offsetTop;
	tempEl = document.getElementById(imgElem).offsetParent;
	while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	return yPos;
}


function positionElementById(mover,target,extraX,extraY){
	var toMove = 	document.getElementById(mover);
	var theTarget = document.getElementById(target);
	var targetX=getImageXfromLeft(target)+extraX;
	var targetY=getImageYfromTop(target)+extraY;

	toMove.style.position="absolute";
	toMove.style.left=targetX+"px";
	toMove.style.top=targetY+"px";
	toMove.style.display='block';

	return true;
}

function hideElementById(mover){
	document.getElementById(mover).style.visibility = "hidden";
}

function showElementById(mover){
	document.getElementById(mover).style.visibility = "visible";
}

// Resize Div
function setFlashWidth(divid, newW){
document.getElementById(divid).style.width = newW+"px";
}

function setFlashHeight(divid, newH){
document.getElementById(divid).style.height = newH+"px"; 
}

function setFlashSize(divid, newW, newH){
setFlashWidth(divid, newW);
setFlashHeight(divid, newH);
}