var return_vote_obj;
var ext_url=URLEncode(location.href);
var ext_atitel=URLEncode(document.title);

function vote_objekt(transport)
{
	if(return_vote_obj._MO_VOTE_OK==1)
	{
		wwPlugIn.onFlushComplete=function(){
			setInnerHTML('vote_val',(return_vote_obj._MO_VOTE_VV/10));
			wwPlugIn.onFlushComplete='';
			location.href=location.href;
		};
		wwPlugIn.flush('vote_flush','#23982b');
		return;
	}
	wwPlugIn.flush('vote_flush','#b73a18')
}
function test_vote_obj(val,xid,obj)
{
	if(val>0)
	{
		new ajax(PPATH+'ajax/vote_objekt.html', {postBody:'OTYP='+obj+'&XID='+xid+'&VAL='+val,onComplete:vote_objekt,evalObj:'return_vote_obj'});
	}
	else
	{
		wwPlugIn.flush('vote_flush','#b73a18')
	}
}

var return_com_obj;
function com_objekt(transport)
{
	if(return_com_obj._MO_COM_STATUS=='_ET_COM_OK')
	{
		setInnerHTML('com_err','');
		wwPlugIn.onFlushComplete=function(){
			wwPlugIn.onFlushComplete='';
			location.href=location.href;
		};
		wwPlugIn.flush('com_flush','#23982b');
		return;
	}
	setInnerHTML('com_err',return_com_obj._MO_COM_ETXT)
	wwPlugIn.flush('com_flush','#b73a18');
    	ww_formsend=false;
	$(ww_formxid).onclick=ww_oldsrc;
	setInnerHTML(ww_formdiv,"");	
}


function test_com_obj(titel,msg,xid,obj,abo)
{

	if(msg!='')
	{
		new ajax(PPATH+'ajax/com_add.html', {postBody:'OTYP='+obj+'&XID='+xid+'&MSG='+URLEncode(msg)+'&TITEL='+URLEncode(titel)+'&MSG1='+URLEncodeNew(msg)+'&TITEL1='+URLEncodeNew(titel)+'&ISABO='+abo+'&REF='+ext_url+'&ARTTI='+ext_atitel,onComplete:com_objekt,evalObj:'return_com_obj'});
	}
	else
	{
		wwPlugIn.flush('com_flush','#b73a18');
		ww_formsend=false;
		$(ww_formxid).onclick=ww_oldsrc;
		setInnerHTML(ww_formdiv,"");		
	}
}

function testm_com_obj(titel,msg,cid)
{

	if(msg!='')
	{
		new ajax(PPATH+'ajax/com_mod.html', {postBody:'CID='+cid+'&MSG='+URLEncode(msg)+'&TITEL='+URLEncode(titel)+'&MSG1='+URLEncodeNew(msg)+'&TITEL1='+URLEncodeNew(titel),onComplete:com_objekt,evalObj:'return_com_obj'});
	}
	else
	{
		wwPlugIn.flush('com_flush','#b73a18')
	}
}

function del_com(cid,xid,typ)
{
	if(confirm('Diesen Kommentar löschen?\nDer Kommentar wird unwiderruflich gelöscht!'))
	{
		new ajax(PAJAX+'com_del.html', {postBody: 'CID='+cid+'&XID='+xid+'&OTYP='+typ, onComplete:function()
		{
			location.href=location.href;
		}});
	}
};

function gp_redcom(bid,num)
{
	var tl='BID='+bid+'&START='+num;
	new ajax (PPATH+'extern/redaktion.html', {postBody: tl, update: 'redbox'});
}

var return_login2;
function getlogin_ext2()
{
	if(return_login2._MO_LOGIN_STATUS=='_ET_LO_OK')
	{
	location.href=location.href;
//		wwPlugIn.onFlushComplete=function(){location.href=location.href;};
//		wwPlugIn.flush('li_flush22','#23982b');
//		return;
	}
	setInnerHTML('loginerr2',return_login2._MO_LOGIN_ETXT);
	if (return_login2._MO_LOGIN_STATUS=='_ET_LO_REVAL') {location.href=PPATH+'revalidieren/'+return_login2._MO_LOGIN_UNAME+'.html'};
	//wwPlugIn.flush('li_flush22','#b73a18')
}

function testlogin_ext2(obj)
{
	stlo=0;
	new ajax(PPATH+'ajax/login.html', {postBody:'NAME='+URLEncode(obj.NAME.value)+'&PW='+URLEncode(obj.PW.value)+'&STLO='+stlo,onComplete:getlogin_ext2,evalObj:'return_login2'});
}

function tempSelec(theForm){
  theForm.focus();
  /* f&uuml;r Internet Explorer */
  if(typeof document.selection != 'undefined') {
    temp_range = document.selection.createRange();
    temp_range.select();
  }
}


