<!--
function LoadDropDownIE() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("navMenu");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
function popupWindow(url)
{
	PopupOptions(url,350,250,0,0,1);
}

function Popup(url, height, width)
{
	var winEd
	winEd = window.open(url,"","width="+width+",height="+height+",toolbar=0,status=0,location=0,menubar=0,scrollbars=0,resizable=0");
	winEd.focus();
}

function PopupOptionsNew(url, height, width, status, scrollbars, resizable)
{
	var winEd
	winEd = window.open(url,"","width="+width+",height="+height+",toolbar=0,status="+status+",location=0,menubar=0,scrollbars="+scrollbars+",resizable="+resizable);
	winEd.focus();
	return false;
}

function PopupOptions(url, height, width, status, scrollbars, resizable)
{
	var winEd
	winEd = window.open(url,"","width="+width+",height="+height+",toolbar=0,status="+status+",location=0,menubar=0,scrollbars="+scrollbars+",resizable="+resizable);
	winEd.focus();
}

function PopupChat(url, height, width, status, scrollbars, resizable, name)
{
	var winEd;
	winEd = window.open(url,name,"width="+width+",height="+height+",toolbar=0,status="+status+",location=0,menubar=0,scrollbars="+scrollbars+",resizable="+resizable);
	winEd.focus();
}

AjaxFunction = function(transport)
{
	var response = transport.responseText.evalJSON();// || "no response text";
	for (var i = 0;i < response.Result.length;i++)
	{
		DoAction(response.Result[i].ResultType,response.Result[i].ResultValue);
	}
}

function DoAction(ActionType, ActionValue)
{
	switch (ActionType.toLowerCase())
	{
		case "invites":
			$("invites").update(ActionValue);
			break;
		case "hi":
			PopupOptions("PopupHi.aspx?Id="+ActionValue,140,250,0,0,1);
			break;
		case "profilevisit":
			PopupOptions("PopupProfileVisit.aspx?Id="+ActionValue,140,250,0,0,1);
			break;
		case "message":
			PopupOptions("PopupMessage.aspx?Id="+ActionValue,140,250,0,0,1);
			break;
		case "online":
			PopupOptions("PopupOnline.aspx?Id="+ActionValue,140,250,0,0,1);
			break;
		case "chat":
			PopupOptions("PopupChatRequest.aspx?Id="+ActionValue,140,250,0,0,1);
			break;	
		//case "initiatechatnew":
		//	PopupOptions("PopupChatRequest.aspx?Id="+ActionValue,560,700,0,0,1);
		//	break;
		//case "openrequest":
		//	PopupOptions("PopupChatRequest.aspx",560,700,0,0,1);
		//	break;
		//case "modifykeepalive":
		//	alert("Changing keep alive refresh rate to "+ActionValue);
		//	KeepAliveTime = ActionValue;
		//	break;
		default:
			break;
	}
}

var KeepAliveTime = 15000; //modifyable by chat initiaition
function KeepAlive()
{
	new Ajax.Request('online.aspx?rand='+Math.random(), { method:'get',   onSuccess: function(transport){ AjaxFunction(transport); },     onFailure: function(){ /*error for ajax failure here*/ }   });
	setTimeout("KeepAlive();",KeepAliveTime);
}

var openPreviewHash = new Object();
function OpenPreview(strUrl, strReplace)
{
	if (openPreviewHash[strReplace] != undefined && typeof(openPreviewHash[strReplace]) == 'boolean' && openPreviewHash[strReplace])
	{
		if (openPreviewHash[strReplace])
		{
			$(strReplace).hide();
			openPreviewHash[strReplace] = false;
			$('img_'+strReplace).src = "images/preview_open.gif"
		}
	}	
	else
	{
		openPreviewHash[strReplace] = true;
		$(strReplace).show();
		$('img_'+strReplace).src = "images/preview_close.gif";
		//$(strReplace).setStyle({display : ""});
		if (strUrl != '')
			new Ajax.Updater({ success: strReplace, failure: 'AjaxError' },	strUrl+"&"+Math.random(), { method: 'get' });
	}	
	return false;
}

function UpdateBox(strReplace, strUrl, strFocusTab, strTabGroup)
{
	CurrentSelectedTab = strFocusTab;
	InitiateTabs(strFocusTab, strTabGroup);
	new Ajax.Updater({ success: strReplace, failure: 'AjaxError' },	strUrl+"&"+Math.random(), { method: 'get' });
	return false;
}

var CurrentCat = "1"; //sports
var CurrentState = "2"; //nsw
var CurrentSelectedTab = "tabs1_1";
function CustomUpdateBox(strReplace, strUrl, strCat, strState, strFocusTab, strTabGroup)
{
	$('state'+CurrentState).removeClassName('selected');
	$('state'+strState).addClassName('selected');
	//CurrentSelectedTab = strFocusTab;
	CurrentCat = strCat;
	var theCat="";
	if (strFocusTab != "tabs1_1")
		theCat = "&cat="+strCat
	CurrentState = strState;
	return UpdateBox(strReplace, strUrl+theCat+"&s="+strState, strFocusTab, strTabGroup);
}

function InitiateTabs(tabName, tabGroup)
{
	LoadTabs(tabGroup);
	ZChange(tabName);
}

function ChangeZIE(strTabId)
{
	if (typeof(document.body.style.maxHeight) == "undefined")
		$(strNodeId).style.left = -13;
}

function LoadTabs(tabName)
{
	var startIndex = 10;
	tabRoot = document.getElementsByName(tabName);
	for (x=0; x<tabRoot.length; x++)
	{
		for (i=0; i<tabRoot[x].childNodes.length; i++) 
		{

			if (tabRoot[x].childNodes[i].nodeName=="LI") 
			{
				strNodeId = tabRoot[x].childNodes[i].id;
				tabRoot[x].childNodes[i].style.zIndex=startIndex--;
				tabRoot[x].childNodes[i].style.marginLeft=-13;
				ChangeZIE(strNodeId);
				$(strNodeId).removeClassName('righton');
				$(strNodeId).addClassName('rightoff');
			}
		}
	}
}

function ZChange(tabId)
{
	$(tabId).style.zIndex = 11;
	$(tabId).removeClassName('rightoff');
	$(tabId).addClassName('righton');
	ChangeZIE(tabId);
}

function InitateChat(lngId, strDiv, strType)
{
	//new Ajax.Request("requestchat.aspx?type="+strType+"&id="+lngId+"&rand="+Math.random(), { method:'get',   onSuccess: function(transport){ AjaxFunction(transport); },     onFailure: function(){  }   });
	//$(strDiv).update('Request sent.');
	//return false;
}

function StandardFormUpdate(strMsgDiv, strURL, strQryNames, strFieldNames)
{
	$(strMsgDiv).update("Please wait...");
	var strQry = "";
	var strQryBreakDown = strQryNames.split(',');
	var strFieldBreakDown = strFieldNames.split(',');
	for (i = 0;i < strQryBreakDown.length;i++)
	{
		strQry += "&"+strQryBreakDown[i]+"="+$(strFieldBreakDown[i]).value;
	}
	strURL = strURL + strQry;
	new Ajax.Updater({ success: strMsgDiv, failure: strMsgDiv },strURL+"&"+Math.random(), { method: 'get' });
}
function StandardUpdate(strMsgDiv, strURL, strQryNames, strFieldNames)
{
	$(strMsgDiv).update("Please wait...");
	var strQry = "";
	var strQryBreakDown = strQryNames.split(',');
	var strFieldBreakDown = strFieldNames.split(',');
	for (i = 0;i < strQryBreakDown.length;i++)
	{
		strQry += "&"+strQryBreakDown[i]+"="+strFieldBreakDown[i];
	}
	strURL = strURL + strQry;
	//new Ajax.Updater({ success: strMsgDiv, failure: strMsgDiv },strURL+"&"+Math.random(), { method: 'get' });
	new Ajax.Request(strURL+"&"+Math.random(), { method:'get',   onSuccess: function(transport){ $(strMsgDiv).update(transport.responseText);CheckBoxes(strMsgDiv); },     onFailure: function(){  }   });
}
function SendToFriendModulePreview()
{
	document.location.href="sendtofriends1.aspx?em="+$('tbEmail').value.replace(/ /g,"+")+"&fn="+$('tbFirstname').value.replace(/ /g,"+")+"&ln="+$('tbLastname').value.replace(/ /g,"+");
}
function SimpleUpdate(strReplace, strURL)
{
	new Ajax.Updater({ success: strReplace, failure: strReplace},strURL+"&"+Math.random(), {method: 'get'});
	return false;
}
function BeginChat(strAlreadyChatUrl, strTestUrl, intLocationId)
{
	new Ajax.Request(strTestUrl+"&"+Math.random(), { method:'get',   onSuccess: function(transport){ ChatRedirect(transport.responseText,intLocationId); },     onFailure: function(){ result = true; }   });
	return false;
}
function ChatRedirect(strResult,intLocationId)
{
	if (strResult != '')
		document.location.href = strResult;
	else
		PopupOptions('CuteSoft_Client/CuteChat/CH_MainForm.Aspx?Location=Lobby&LocationId='+intLocationId,500,600,0,0,1);
}
//-->