function OpenProfileWindow( u )
{
	var w = window.open( u, "_profilewindow_", 'resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no,width=640px,height=640' );
	if( w ){
		w.focus();
	}
}

function OpenMembersProfileASPX( id ) {
    if (isNaN(id)) {
        OpenProfileWindow("/MembersProfile.aspx?UserId=" + id);
    } else {
        OpenProfileWindow("/MembersProfile.aspx?uid=" + id);
    }
}

function OpenMembersDiaryASPX( id )
{
	OpenProfileWindow( "/MembersProfileDiary.aspx?uid=" + id );
}

function openUserPlaneChatWindow( name )
{
	var winName;
	winName = "39103a9db9b4733e2fc8f30f75fbabb4";
			
	var url = 'http://www.userplane.com/chatlite/run/chat.cfm?app_str=ch&domainID=39103a9db9b4733e2fc8f30f75fbabb4&name=' + name;
	var features;
	features  = 'width=738,';
	features += 'height=585,';
	features += 'toolbar=0,';
	features += 'directories=0,';
	features += 'menubar=0,';
	features += 'status=0,';
	features += 'location=0,';
	features += 'scrollbars=0,';
	features += 'resizable=1';
	
	myWin = window.open( url, winName, features );	

	//document.forms['ChatForm'].submit();
}


function openMessageWindow(uid)
{
	var w = window.open('/MembersSM.srf?to=' + uid, '_blank', 'location=no,menubar=no,toolbar=no,width=460px,height=320');
	w.focus();
}
function openMessageWindowASPX(uid)
{
	var w = window.open('/MembersSendMessage.aspx?to=' + uid, '_blank', 'location=no,menubar=no,toolbar=no,width=460px,height=400');
	w.focus();
}
function openPagerWindow(uid)
{
	var w = window.open('/MembersPager.srf?to=' + uid, '_blank', 'location=no,menubar=no,toolbar=no,width=460px,height=320');
	w.focus();
}

function openPagerWindowASPX(uid)
{
	var w = window.open('/MembersPager.aspx?to=' + uid, '_blank', 'location=no,menubar=no,toolbar=no,width=460px,height=400');
	w.focus();
}

function openPagerReaderASPX( mid )
{
	var w = window.open('/Members/MembersPagerReader.aspx' + (mid != null ? '?mid=' + mid : '') , '_blank', 'location=no,menubar=no,toolbar=no,width=460px,height=400');
	w.focus();
}

function submitrate()
{
	var iMyWidth;
	var iMyHeight;
	var url, myscore;
	iMyWidth = (window.screen.width/2) - 200; //half the screen width minus half the new window width (plus 5 pixel borders).
	iMyHeight = (window.screen.height/2) - 50; //half the screen height minus half the new window height (plus title and status bars).
	var windowprops = "width=400,height=100,location=no,toolbar=no,menubar=no,scrollbars=auto,resizable=yes,left="+iMyWidth+",top="+iMyHeight+",screenX="+iMyWidth+",screenY="+iMyHeight;
	var w = window.open("", "ratingwindow", windowprops);
	w.focus();
	document.rateform.submit();
}

function IsValidEmailAddress( value )
{
    var rx = new RegExp(/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
    var matches = rx.exec(value);
    return (matches != null && value == matches[0]);
}

