function pop(sUrl, iWidth, iHeight) {
	var iMyWidth;
	var iMyHeight;
	if(!iWidth) {
		iWidth=250;
	}
	if(!iHeight) {
		iHeight=350;
	}
	
	//gets top and left positions based on user's resolution so hint window is centered.
	iMyWidth = (window.screen.width/2) - (iWidth/2 + 10); //half the screen width minus half the new window width (plus 5 pixel borders).
	iMyHeight = (window.screen.height/2) - (iHeight/2 + 50); //half the screen height minus half the new window height (plus title and status bars).
	var win2 = window.open(sUrl,"Help","status,height="+iHeight+",width="+iWidth+",resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=yes");
	win2.focus();
  return false;
}

function popIt(sUrl) {
    window.open(sURL);
}


/***********************************************
* Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated Oct 21st, 2003.
* Visit http://www.dynamicdrive.com/ for full source code
* http://www.dynamicdrive.com/dynamicindex1/navigate2.htm
***********************************************/

var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)
var cssclassforhiddencontent="HiddenNews" // Assign this style to 'display: none' in your stylesheet
var ccollect=new Array();

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function alwaysexpandcontent(element){
	if (typeof element!="undefined"){
	element.style.display="block";
	}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
getElementbyClass(cssclassforhiddencontent)
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}
document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
getElementbyClass(cssclassforhiddencontent)
if (enablepersist=="on" && typeof ccollect!="undefined")
revivecontent()
var sa = document.getElementById("chkViewAll");
if (sa.checked)
	toggleQuestions(sa.checked);
}

function toggleAll()
{
	var sa = document.getElementById("chkViewAll");
	toggleQuestions(sa.checked);
}

function toggleQuestions(checked)
{
	getElementbyClass(cssclassforhiddencontent);
	if (typeof ccollect!="undefined")
	{
		var inc=0;
		while (ccollect[inc]){
			if(checked == true)
				alwaysexpandcontent(ccollect[inc]);
			else
				contractcontent(ccollect[inc]);
			inc++;
		}
	}
}



/* Execute following code at run-time */

if (window.addEventListener) {
window.addEventListener("load", do_onload, false);
}
else if (window.attachEvent) {
window.attachEvent("onload", do_onload);
}
else if (document.getElementById) {
window.onload=do_onload
}

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate;

/*****************************************************/



/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/


	//original values: 12, 10, 10, 14
	
	//Customize x offset of tooltip relative to mouse location
	var offsetfromcursorX=0 
	//Customize y offset of tooltip
	var offsetfromcursorY=-25 
	
	//Customize x offset of tooltip DIV relative to pointer image
	// This is the location where the pointer triangle touches the popup info box
	var offsetdivfrompointerX=30 
	//Customize y offset of tooltip DIV relative to pointer image. 
	// Tip: Set it to (height_of_pointer_image-1) for images dropping below the mouse.
	// Tip: Set it to (offsetfromcursorY-1) for images rising above the mouse.
	var offsetdivfrompointerY=-21 
	
	var ie=document.all
	var ns6=document.getElementById && !document.all
	var enabletip=false
	if (ie||ns6)
	{
		document.write('<div id="dhtmltooltip"></div>'); //write out tooltip DIV
		document.write('<img id="dhtmlpointer" src="/demo/anped/images/glossarybubblearrow-up.gif">') //write out pointer image
		var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
		var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""
	}




function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip;



