var g_img=new Array();
function fGo(opt,signedin){
	var href="",cx,cy;
	switch(opt){
		case 3:
			cx=(g_scr.width-700)/2;cy=(g_scr.height-510)/2-25;
			g_win_upd=window.open("upd.php?cmd=newa","upd","toolbar=0,height=450,width=700,left="+cx+",top="+cy+",screenX="+cx+",screenY="+cy+",scrollbars=1,resizable=1,status=1");
			if(!g_win_upd){
				alert("The Posting Editor failed to open.\n\nUpdate your browser settings to allow \npopups for this Site.\n\nYou can also open Posting Editor by clicking \nPost Available on the top banner.\n");
			}else{g_win_upd.focus();}
			return void(0);
			break;
		case 4:
			if(signedin==2){
				alert("You are signed in for an assistant wanted  \npage.\n\nTo edit an assistant available page, \nsign off and sign in again with the assistant \navailable user name and passcode.\n\n");
			}else{fL(signedin);}
			return void(0);
			break;
		case 8:
			cx=(g_scr.width-700)/2;cy=(g_scr.height-510)/2-25;
			g_win_upd=window.open("upd.php?cmd=neww","upd","toolbar=0,height=450,width=700,left="+cx+",top="+cy+",screenX="+cx+",screenY="+cy+",scrollbars=1,resizable=1,status=1");
			if(!g_win_upd){
				alert("The Posting Editor failed to open.\n\nUpdate your browser settings to allow \npopups for this Site.\n\nYou can also open Posting Editor by clicking\nPost Wanted on the top banner.\n");
			}else{g_win_upd.focus();}
			return void(0);break;
		case 9:
			if(signedin==2){
				alert("You are signed in for an assistant available  \npage.\n\nTo edit an assistant wanted page, \nsign off and sign in again with the assistant \nwanted user name and passcode.\n\n");
			}else{fL(signedin);}
			return void(0);
			break;
	}
	if(href !=""){document.location.href=href;}
	return void(0);}
function fL(signedin){
	var cx, cy;
	if(signedin==1){
		cx=(g_scr.width-700)/2;cy=(g_scr.height-510)/2-25;
		g_win_upd=window.open("upd.php?cmd=edit","upd","toolbar=0,height=450,width=700,left="+cx+",top="+cy+",screenX="+cx+",screenY="+cy+",scrollbars=1,resizable=1,status=1" );
		if(!g_win_upd){
			alert("The Posting Editor failed to open.\n\nUpdate your browser settings to allow \npopups for this Site.\n\nYou can also open Posting Editor by clicking Edit Available or Edit Wanted\n on the top banner.\n\n");
		}else{g_win_upd.focus();}
	}else{
		cx=(g_scr.width-450)/2;cy=(g_scr.height-360)/2-50;
		g_win_login=window.open("login.php","login","toolbar=0,height=360,width=450,left="+cx+",top="+cy+",screenX="+cx+",screenY="+cy+",scrollbars=1,resizable=1,status=1");
		if(!g_win_login){
			alert("The Sign In window failed to open.\n\nUpdate your browser settings to allow \npopups for this Site.\n\nYou can also open the window manually by clicking \nSign In at top.\n\n");
		}else{g_win_login.focus();}}
	return void(0);}
function fLOff(){
	var cx,cy; 
	cx=(g_scr.width-450)/2;cy=(g_scr.height-250)/2-50;
	g_win_logoff=window.open("logoff.php","logoff","toolbar=0,height=250,width=450,left="+cx+",top="+cy+",screenX="+cx+",screenY="+cy+",scrollbars=1,resizable=1,status=1");
	g_win_logoff.focus();fSignIn('','',0);return void(0);}
function fTogS(sn, db,signedin,href,title,t1,t2,t3){
	var e=fID('a_login'),r;
	e.href=href;e.title=title;e.accessKey=t2;
	e.childNodes.item(0).nodeValue=t1;
	e.childNodes.item(1).firstChild.nodeValue=t2;
	e.childNodes.item(2).nodeValue=t3;
	e=fID("log_status").childNodes.item(0);
	if(signedin==0)
		e.nodeValue="logged off";
	else
		e.nodeValue="welcome "+sn+"!";
	e=fID("a_edit_a");
	if(signedin==1 && db=='a')
		e.href="javascript:fGo(4,1)";
	else if(signedin==1 && db=='w')
		e.href="javascript:fGo(4,2)";
	else
		e.href="javascript:fGo(4,0)";
	e=fID("a_edit_w");
	if(signedin==1 && db=='w')
		e.href="javascript:fGo(9,1)";
	else if(signedin==1 && db=='a')
		e.href="javascript:fGo(9,2)";
	else
		e.href="javascript:fGo(9,0)";
	return 1;}
function fSignIn(sn, db, s){
	if(s != 0){fTogS(sn,db,1,"javascript:fLOff()","Sign Off","+ Sign ","O","ff");
	}else{fTogS(sn,db,0,"javascript:fL(0)","Sign in to edit, change active status, and delete your Assistant Page","+ Sign ","I","n");}
	return 1;}
function fDBChanged(){
	return 1;}