function pleaseWait(element)
{
    element.value = "Please Wait ...";
    element.disabled = true;
    element.form.submit();
}

function youGotMail()
{
    if (confirm('YOU GOT NEW PRIVATE MESSAGE(S)!!!\n\nCheck your private message(s) now?'))  {   
        location.href='../profile/index.php?action=inbox';
    }
//   alert("TEST");
}

function openNewWin(myURL, myTarget, myWidth, myHeight, resize)
{
   var left = (screen.width - myWidth) / 2;
   var top = (screen.height - myHeight) / 2;
   if (!resize || (resize == "")) { resize = 0; }   
   var option = "width = " + myWidth + ", height = " + myHeight + ", top = " + top + ", scrollbars=1, resizable = " + resize + ", left=" + left;
   var newWindow = window.open(myURL, myTarget, option); 
   newWindow.focus();
}


function setMeFocus(myForm, myID)
{
   document.forms[myForm].myID.focus();
}


function goto(url) {
       window.location=url;
}

function goBack() {
    history.go(-1);
}

function display(termID) {
	var termToExp = document.getElementById(termID);
	if (termToExp !=null) {
		termToExp.style.display = "";
	}
}

function hide(termID) {
	var termToExp = document.getElementById(termID);
	if (termToExp !=null) {
		termToExp.style.display = "none";
	}
}

function toggleMe(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  return true;
}

function confirmDelete(){
    if (confirm("Are you sure you want to delete?")) {
        return true;
    }
    else {
        return false;
    }
}

function setUbbCode(ubbCode) {
    var ele = document.getElementById("ctl00_ContentPlaceHolder1_txtMessage");
    ele.value = ele.value + ubbCode;
}

function focusUsername() {
    var element;
    for(var i=0; i<document.forms[0].elements.length; i++)
    {    
        element = document.forms[0].elements[i];
        if (instr(element.id, "LoginView1_Login1_UserName")) {
            element.focus();
            return;
        }       
    }
    return;
}

function instr(fullString, findMe) {
  if (fullString.indexOf(findMe) != -1) {
    return true;
  }
  return false;
}
function switchHomeTab(tabName, totalTabs, activeTabId) {	   
    var thisTab;
    for (var i=0;i<=totalTabs;i++){
        thisTab = document.getElementById(tabName + i);		        		       
        if (i == activeTabId) {		                         thisTab.style.display = "";
        }
        else {	                    thisTab.style.display = "none";
        }		        
    }
}	


