// JavaScript Document
/*

Written & (c) www.Thinkcyber.com
Example:
*/



imgout=new Image(9,9);
imgin=new Image(9,9);

/////////////////BEGIN USER EDITABLE///////////////////////////////
	imgout.src="/global/images/icons/expand.gif";
	imgin.src="/global/images/icons/collapse.gif";
///////////////END USER EDITABLE///////////////////////////////////

//this switches expand collapse icons
function filter(imagename,objectsrc){
	if (document.images){
		document.images[imagename].src=eval(objectsrc+".src");
	}
}


//show OR hide funtion depends on if element is shown or hidden
function thinkcyber(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			filter(("img"+id),'imgin');			
		} else {
			filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				filter(("img"+id),'imgin');
			} else {
				filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}


/*
div#commentForm
{
  margin: 0px 20px 0px 20px;
  display: none;
}
<div id="commentForm">
</div>

<a href="javascript:toggleLayer('commentForm');" title="Add a comment to this entry">
Add a comment
</a>
<input type="reset" name="reset" value="Cancel"
onclick="javascript:toggleLayer('commentForm');" />

*/


function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}


		var rating_url = 'http://www.thinkcyber.com/';
		function toggleMemberMenu(flag){
			var menuContainer = document.getElementById("mMenu");
			var titleBg = document.getElementById("member-title-bg");
			var bgStart = document.getElementById("member-title-bg-st");

			if(menuContainer.style.display == "none") {
				menuContainer.style.display = "block";
				titleBg.className = "member-title-bg" + flag + "-hov";
				bgStart.className = "member-title-bg-st-hov";
			}else{
				menuContainer.style.display = "none";
				titleBg.className = "member-title-bg";
				bgStart.className = "";
			}
		}
		
function ShowHide(id1, id2) {
  if (id1 != '') expMenu(id1);
  if (id2 != '') expMenu(id2);
}

function expMenu(id) {
  var itm = null;
  if (document.getElementById) {
    itm = document.getElementById(id);
  } else if (document.all){
    itm = document.all[id];
  } else if (document.layers){
    itm = document.layers[id];
  }

  if (!itm) {
   // do nothing
  }
  else if (itm.style) {
    if (itm.style.display == "none") { itm.style.display = ""; }
    else { itm.style.display = "none"; }
  }
  else { itm.visibility = "show"; }
}


function ChangeUrl(newLoc) {
	newPage = newLoc.options[newLoc.selectedIndex].value;
	
	if (newPage != "") {
	  top.location = newPage
	}
}

