<!--//
var message="Sorry, that function is disabled.\n\n\n";
function clickIE() {
	if (document.all) {
		alert(message);
		return false;
	}
}
function clickNS(e) {
	if (document.layers || (document.getElementById && !document.all)) {
		if (e.which==2||e.which==3) {
			alert(message);
			return false;
		}
	}
}
if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS;
} else {
	document.onmouseup=clickNS;
	document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false")


function display(str) {
window.status = str;
  return true;
}

function cancelEvent() {
	window.event.returnValue = false;
}

function showPopup() { //v3.0
  var i,p,v,obj,args=showPopup.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=POP_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
function POP_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function changeCase(frmObj) {
	var index;
	var tmpStr;
	var tmpChar;
	var preString;
	var postString;
	var strlen;
	tmpStr = frmObj.value.toLowerCase();
	strLen = tmpStr.length;
	if (strLen > 0)  {
		for (index = 0; index < strLen; index++)  {
			if (index == 0)  {
				tmpChar = tmpStr.substring(0,1).toUpperCase();
				postString = tmpStr.substring(1,strLen);
				tmpStr = tmpChar + postString;
			} else {
				tmpChar = tmpStr.substring(index, index+1);
				if (tmpChar == " " && index < (strLen-1))  {
					tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
					preString = tmpStr.substring(0, index+1);
					postString = tmpStr.substring(index+2,strLen);
					tmpStr = preString + tmpChar + postString;
				}
			}
		}
	}
	frmObj.value = tmpStr;
}
function changeLower(frmObj) {
	var tmpStr;
	tmpStr = frmObj.value.toLowerCase();
	frmObj.value = tmpStr;
}
function changeUpper(frmObj) {
	var tmpStr;
	tmpStr = frmObj.value.toUpperCase();
	frmObj.value = tmpStr;
}

function show(object) {
	if (document.layers && document.layers[object]) {
		document.layers[object].visibility = 'visible';
//	} else if (document.all) {
//		document.all[object].style.visibility = 'visible';
	} else if (!document.all && document.getElementById) {
		document.getElementById(object).style.visibility = 'visible';
	} else if (document.getElementById) {
		document.getElementById(object).style.visibility = 'visible';
	}
}
function hide(object) {
	if (document.layers && document.layers[object]) {
		document.layers[object].visibility = 'hidden';
//	} else if (document.all) {
//		document.all[object].style.visibility = 'hidden';
	} else if (!document.all && document.getElementById) {
		document.getElementById(object).style.visibility = 'hidden';
	} else if (document.getElementById) {
		document.getElementById(object).style.visibility = 'hidden';
	}
}

function showOffset(object,x,y) {
    if (document.layers && document.layers[object]) {
        document.layers[object].left += x;
        document.layers[object].top += y;
        document.layers[object].visibility = 'visible';
    } else if (document.all) {
        document.all[object].style.posLeft = document.all[object].offsetLeft + x;
        document.all[object].style.posTop = document.all[object].offsetTop + y;
        document.all[object].style.visibility = 'visible';
    }
}

function hideOffset(object,x,y) {
    if (document.layers && document.layers[object]) {
        document.layers[object].visibility = 'hidden';
        document.layers[object].left -= x;
        document.layers[object].top -= y;
    } else if (document.all) {
        document.all[object].style.visibility = 'hidden';
        document.all[object].style.posLeft -= x;
        document.all[object].style.posTop -= y;
    }
}

function SelectAllMessages() {
	for (var i = 0; i < document.messages.elements.length; i++) {
		if (document.messages.elements[i].type == 'checkbox') {
			document.messages.elements[i].checked = !(document.messages.elements[i].checked);
		}
	}
}

function centerPopUp( url, name, width, height, scrollbars ) { 
	if( scrollbars == null ) scrollbars = "0" 
	str  = ""; 
	str += "scrollbars=" + scrollbars + ","; 
	str += "width=" + width + ","; 
	str += "height=" + height + ","; 
	str += "toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,resizable=no";
	if (window.screen) { 
		var ah = screen.availHeight - 30; 
		var aw = screen.availWidth - 10; 
		var xc = ( aw - width ) / 2; 
		var yc = ( ah - height ) / 2; 
		str += ",left=" + xc + ",screenX=" + xc; 
		str += ",top=" + yc + ",screenY=" + yc; 
	} 
	window.open( url, name, str ); 
} 

function launchIC( userID, destinationUserID ) {
	var popupWindowTest = window.open( "/members/chat/im/ic.php?strDestinationMemberID=" + destinationUserID, "ICWindow_" + replaceAlpha(userID) + "_" + replaceAlpha(destinationUserID), "width=360,height=420,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=0" );
	if ( popupWindowTest == null ) {
		if ( confirm( "Your popup blocker stopped an InstantCommunicator window from opening\nPlease disable it and then click 'ok'" ) ) {
			launchIC( userID, destinationUserID );
		}
	}
}
		
function replaceAlpha( strIn ) {
	var strOut = "";
	for ( var i = 0 ; i < strIn.length ; i++ ) {
		var cChar = strIn.charAt(i);
		if( ( cChar >= 'A' && cChar <= 'Z' ) || ( cChar >= 'a' && cChar <= 'z' ) || ( cChar >= '0' && cChar <= '9' ) ) {
			strOut += cChar;
		} else {
			strOut += "_";
		}
	}
	return strOut;
}

function getObj(name) {
	if (document.getElementById) {
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	} else if (document.all) {
		this.obj = document.all[name];
		this.style = document.all[name].style;
	} else if (document.layers) {
		this.obj = document.layers[name];
		this.style = document.layers[name];
	}
}
//-->