/*
	DHTML popInfo v0.3
	writen by: me@daantje.nl
	last update: 23 Jul 2003 - 01:46

	documentation:
		This script will pop up a DIV element with the given HTML.
		Just like the TITLE atribute on the A tags... Only this one understands
		HTML and will be visible until you pull out on the link...
		Also build a funtion to replace the title attributes on given tags.
		You can call this function onload of the page. This function only works
		on Mozilla/Netscape like browsers. Not MSIE... Have to dive into the
		M$ reference :-(

	license:
		This script is FREE to use! You may copy, edit
		or use this script in ANY way possible!
		But please, mention me in your credits...
*/

//
// configuration
//
var infDivID = 'popInfoDiv'; //ID of the <DIV> tag
var infDivOverlap = 0; //pixels ovelap on link
var infDivOutTime = 10; //amount of seconds before hidding
var replaceTitleAttribIn = new Array('a','div','input','span','select','img');	//search for these tags, and replace title attributes

//
// needed
//
var tmr;
var lastPopInfo;

//
// pop up an info DIV.
// call with empty txt value to hide the object.
//
function popInfo(obj,txt){
	if(obj){
		//get popup div element
		infDiv = document.getElementById(infDivID);
		if(infDiv){
			//kill timer
			clearTimeout(tmr);
			//check what to do... over or out...
			if(txt){
				//kill last pop div, when one is there....
				if(lastPopInfo)
					infDiv.style.visibility = "hidden";
				//get position
				t = obj.offsetTop;
				l = obj.offsetLeft;
				//patch position when we are in an other element...
				if(obj.offsetParent && (obj.offsetParent.offsetTop || obj.offsetParent.offsetLeft)){
					obj2 = obj;
					while(obj2.offsetParent){
						t += obj2.offsetParent.offsetTop;
						l += obj2.offsetParent.offsetLeft;
						obj2 = obj2.offsetParent;
					}
				}
				//puse the popup to the link....
				infDiv.style.top = t + obj.offsetHeight - infDivOverlap;
				infDiv.style.left = l + obj.offsetHeight - infDivOverlap;
				infDiv.innerHTML = txt; //set text...
				infDiv.style.visibility = "visible"; //make it visible
				lastPopInfo = infDiv; //remember current div for next over or out...
			} else {
				//it's an out... kill it on a timer...
				tmr = setTimeout('infDiv.style.visibility = "hidden"', (infDivOutTime * 100));
			}
		}
	}
}

//this function will replace all found title attriubutes
//with popInfo calls... (You may want to use this onload...)
function changeTitleToPopInfo(){
	//loop tags
	for(j=0;j<replaceTitleAttribIn.length;j++){
		//get all this kind of tags
		doc = document.getElementsByTagName(replaceTitleAttribIn[j]);
		for(i=0;i<doc.length;i++){
			//remember title contents
			txt = doc[i].getAttribute('title');
			if(txt && !document.all){
				//make new attributes... Only Netscape compatible... For some strange reason...
				//It should work, but it doesn't, have to check it again...
				ov = doc[i].setAttribute('onmouseover',"popInfo(this,'"+txt+"')");
				ou = doc[i].setAttribute('onmouseout',"popInfo(this)");
				//remove the title...
				doc[i].removeAttribute('title');
			}
		}
	}
}


<!--
	//
	// Nannette Thacker http://www.shiningstar.net
	//
function confirmSubmit() {
	var agree=confirm("Are you sure you wish to continue?");
	if (agree)
		return true ;
	else
		return false ;
}
// -->

/***********************************************
* Switch Content script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated April 2nd, 2005.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//
// Somewhat modified by Kattare Internet Services to fit our needs.
//

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 contractsymbol='<img src="/images/tree_minus.gif"> ' //HTML for contract symbol. For image, use: <img src="whatever.gif">
var expandsymbol='<img src="/images/tree_plus.gif"> ' //HTML for expand symbol.

if (document.getElementById) {
    document.write('<style type="text/css">')
    document.write('.switchcontent{display:none;}')
    document.write('</style>')
}

function getElementbyClass(rootobj, classname) {
    var temparray=new Array()
    var inc=0
    var rootlength=rootobj.length
    for (i=0; i<rootlength; i++) {
        if (rootobj[i].className==classname)
            temparray[inc++]=rootobj[i]
    }
    return temparray
}

function sweeptoggle(ec) {
    var thestate=(ec=="expand")? "block" : "none"
    var inc=0
    while (ccollect[inc]) {
        ccollect[inc].style.display=thestate
        if ( ec == "expand" ) {
            if ( window.frames['IF'+ccollect[inc].id] ) {
				var wfid = 'IF'+ccollect[inc].id;
                window.frames[wfid].location.href = '/members/email_iframe.kvws?cid=' + ccollect[inc].id;   
            }
            if ( window.frames['DOM'+ccollect[inc].id] ) {
				var wfid = 'DOM'+ccollect[inc].id;
                //EB//window.frames[wfid].location.href = 'https://www.kattare.com/members/domain_iframe.kvws?cid=' + ccollect[inc].id;   
                window.frames[wfid].location.href = '/members/domain_iframe.kvws?cid=' + ccollect[inc].id;   
            }
			if ( window.frames['SIGNUP'+ccollect[inc].id] ) {
				var wfid = 'SIGNUP'+ccollect[inc].id;
				//EB//window.frames[wfid].location.href = 'https://www.kattare.com/admin/add-client.kvws?load=1&md5_id=' + ccollect[inc].id;   
				window.frames[wfid].location.href = '/admin/add-client.kvws?load=1&md5_id=' + ccollect[inc].id;   
			}
		}
		inc++
	}
	revivestatus()
}

function contractcontent(omit) {
    var inc=0
    while (ccollect[inc]) {
        if (ccollect[inc].id!=omit)
            ccollect[inc].style.display="none"
        inc++
    }
}

function expandcontent(curobj, cid) {
    var spantags=curobj.getElementsByTagName("SPAN")
    var showstateobj=getElementbyClass(spantags, "showstate")
    if (ccollect.length>0) {
        if (collapseprevious=="yes") {
            contractcontent(cid);
        }
        document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
        if (document.getElementById(cid).style.display == "block") {
            if ( window.frames['IF'+cid] ) {
				var wfid = 'IF'+cid;
				// document.getElementById(wfid).src = 'https://www.kattare.com/members/email_iframe.kvws?cid=' + cid;   
                window.frames[wfid].location.href = '/members/email_iframe.kvws?cid=' + cid;   
            }
            if ( window.frames['DOM'+cid] ) {
				var wfid = 'DOM'+cid;
				// document.getElementById(wfid).src = 'https://www.kattare.com/members/domain_iframe.kvws?cid=' + cid;   
                //EB//window.frames[wfid].location.href = 'https://www.kattare.com/members/domain_iframe.kvws?cid=' + cid;   
                window.frames[wfid].location.href = '/members/domain_iframe.kvws?cid=' + cid;   
            }
			if ( window.frames['SIGNUP'+cid] ) {
				var wfid = 'SIGNUP'+cid;
				// document.getElementById(wfid).src = 'https://www.kattare.com/members/domain_iframe.kvws?cid=' + cid;   
				//EB//window.frames[wfid].location.href = 'https://www.kattare.com/admin/add-client.kvws?load=1&md5_id=' + cid;   
				window.frames[wfid].location.href = '/admin/add-client.kvws?load=1&md5_id=' + cid;   
			}
        }
        if (showstateobj.length>0) { //if "showstate" span exists in header
            if (collapseprevious=="no")
                showstateobj[0].innerHTML=(document.getElementById(cid).style.display=="block")? contractsymbol : expandsymbol
            else
                revivestatus()
        }
    }
}

function revivecontent() {
    var cid='';
    contractcontent("omitnothing")
    selectedItem=getselectedItem()
    selectedComponents=selectedItem.split("|")
    for (i=0; i<selectedComponents.length-1; i++) {
        cid=selectedComponents[i];
        // document.write('<center>hi there ' + selectedComponents[i] + '</center>');
		document.getElementById(cid).style.display="block"
        if ( window.frames['IF'+cid] ) {
			// document.getElementById('IF'+cid).src = 'https://www.kattare.com/members/email_iframe.kvws?cid=' + cid;   
            window.frames['IF'+cid].location.href = '/members/email_iframe.kvws?cid=' + cid;   
        }
        if ( window.frames['DOM'+cid] ) {
			// document.getElementById('DOM'+cid).src = 'https://www.kattare.com/members/domain_iframe.kvws?cid=' + cid;   
            window.frames['DOM'+cid].location.href = '/members/domain_iframe.kvws?cid=' + cid;   
        }
        if ( window.frames['SIGNUP'+cid] ) {
            window.frames['SIGNUP'+cid].location.href = '/members/add-client.kvws?load=1&md5_id=' + cid;   
        }
    }
}

function revivestatus() {
    var inc=0
    while (statecollect[inc]) {
        if (ccollect[inc].style.display=="block")
            statecollect[inc].innerHTML=contractsymbol
        else
            statecollect[inc].innerHTML=expandsymbol
        inc++
    }
}

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=""
	while (ccollect[inc]) {
		if (ccollect[inc].style.display=="block")
			selectedItem+=ccollect[inc].id+"|"
		inc++
	}
	document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload() {
    uniqueidn=window.location.pathname+"firsttimeload"
    var alltags=document.all? document.all : document.getElementsByTagName("*")
    ccollect=getElementbyClass(alltags, "switchcontent")
    statecollect=getElementbyClass(alltags, "showstate")
    if (enablepersist=="on" && ccollect.length>0) {
        document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
        firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
        if (!firsttimeload)
            revivecontent()
    }
    if (ccollect.length>0 && statecollect.length>0)
        revivestatus()
}

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

//
// Resize iframes on load
//
function resizeIframe(frameid) {
    var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
    var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
    var currentfr=document.getElementById(frameid)
    if (currentfr && !window.opera) {
        currentfr.style.display="block"
        if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
            currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
        else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
            currentfr.height = currentfr.Document.body.scrollHeight;
    }
}

  <!--
	function display_window(url){
		window.open(url,'y','width=640,height=480,top=0,left=0,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=no,screenX=450,screenY=100');
		return false;
	}

	function popup(source){
		newView = window.open(source,'popup','width=640,height=480 resizable=no,scrollbars=yes,toolbar=no')
		newView.focus();
	}

  function selectAll(formObj, isInverse) {
    for (var i=0;i < formObj.length;i++)
    {
      fldObj = formObj.elements[i];
      if (fldObj.type == 'checkbox')
      {
        if(isInverse)
          fldObj.checked = (fldObj.checked) ? false : true;
        else fldObj.checked = true;
      }
    }
  }

  function linkSelect(ob,winWidth,winHeight) {
    toBeBrokenDown = ob.options[ob.selectedIndex].value.split("|");

    targetWindow = toBeBrokenDown[0];
    targetURL    = toBeBrokenDown[1];

    if (targetWindow!=='') {
      // if a new Window name is specified, then it will
      // open in a new Window.

      window.open(targetURL,targetWindow,'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=' + winWidth + ',height=' + winHeight + '');

      // if we open a new window, then we have to re-set
      // the select box to the first option
      // which should have no value

      ob.selectedIndex = 0;
    } else {
      // or else it will open in the current window        

      window.open(targetURL,'_top')
    }
}

function setFocusLogin() {
    document.loginform.session_login_form.focus();
}

function purgeDiv(thisObj) {
	document.getElementById(thisObj).innerHTML = "";
}

function hideDiv(thisObj) {
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(thisObj).style.visibility = 'hidden';
	} else {
		if (document.layers) { // Netscape 4
			document.thisObj.visibility = 'hidden';
		} else { // IE 4
			document.all.thisObj.style.visibility = 'hidden';
		}
	}
}

function showDiv(thisObj) {
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(thisObj).style.visibility = 'visible';
	} else {
		if (document.layers) { // Netscape 4
			document.thisObj.visibility = 'visible';
		} else { // IE 4
			document.all.thisObj.style.visibility = 'visible';
		}
	}
} 

//-->
