// all javascript functions for dol
// very up to date - 22.3.2003 - tm


function open_beitritt_austritt( partei_id, beitritt ) {
  window.open("beitritt_austritt.php3?partei_id="+partei_id+"&beitritt="+beitritt,"","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width=400,height=400");
}

function open_beitritt_austritt_ini( ini_id, beitritt ) {
  window.open("beitritt_austritt_ini.php3?ini_id="+ini_id+"&beitritt="+beitritt,"","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width=380,height=300");
}

function open_help( url, passage ) {
  window.open(url+"#"+passage,"","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width=500,height=400");
}

function open_kategorien(form) {
  if (form.kategorie_id.selectedIndex!=0) {
    form.submit();
  }
}

function open_mitglieder_uebersicht(partei_id) {
  window.open("partei_mitglieder_uebersicht.php3?partei_id="+partei_id,"","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width=600,height=400");
}

function open_nachricht_write( recipient_pid ) {
	window.open("nachricht.php3?recipient_pid="+recipient_pid,"","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width=610,height=400");
}

function open_nachricht_read( message_id ) {
	window.open("nachricht_lesen.php3?message_id="+message_id,"","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width=610,height=400");
}


function open_partei_programm(themen_id, partei_id) {
  window.open("partei_programm.php3?partei_id="+partei_id+"&themen_id="+themen_id,"","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width=600,height=500");
}

function open_parteien(form) {
  if (form.partei_id.selectedIndex != 0 ) {
    form.submit();
  }
}

function open_std_window_pid( url, pid, width, height ) {
  window.open(url+"?pid="+pid,"","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width="+width+",height="+height);
}

function open_std_window_partei_id( url, partei_id, width, height ) {
  window.open(url+"?partei_id="+partei_id, "", "toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width="+width+",height="+height);
}

function open_std_window_koalition_id( url, koalition_id, width, height ) {
  window.open(url+"?koalition_id="+koalition_id, "", "toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width="+width+",height="+height);
}

function open_std_window_chat_id( url, chat_id, width, height ) {
      window.open(url+"?chat_id="+chat_id, "", "toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width="+width+",height="+height);
}

function open_std_window( url, width, height ) {
  window.open( url, "", "toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width="+width+",height="+height );
}

function open_std_window2( url, width, height ) {
  window.open( url, "", "toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width="+width+",height="+height );
}

function open_std_window_ini( url, width, height, ini_id, volk ) {
  window.open( url + "?ini_id=" + ini_id + "&volk=" + volk , "", "toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,width="+width+",height="+height );
}

function openPublicWin(dUrl,wName,wWidth,wHeight,wParam) 
{
      var paramString = "";
      if (! dUrl) { alert("Error: URL fehlt!"); return; }
      if (! wName) { wName = "usrWin"; }
      if (wWidth) { paramString = "width="+wWidth; }
      if (wHeight) { paramString += ",height="+wHeight; }
      if (wParam) { paramString += ","+wParam; }
      window.open(dUrl,wName,paramString);
}



// highscore-function, fifi, 21.3.05
toggle = 1



function HighscoreShowHeader ( text )
{
	t=
	'<table cellpadding=3 cellspacing=0 border=0 width="169">'+
	'<tr>'+
	'<td class="standard"><font size=-2><img src="/img/cross.gif" width=8 height=8 alt="" align=left border=0>&nbsp;<b>' +text+ '</b></font></td>'+
	'</tr>'+
	'</table>'

	document.writeln(t)
}

function HighscoreShow ( id, nickname, partei_id, score )
{
	t=
	'<table cellpadding=3 cellspacing=0 border=0 width=169>'+
	'<tr>'+
	' <td width="84"><font size=-2><a href="index.php3?position=1700&pid=' +id+ '\">' +nickname+ '</a></font></td>'+
	' <td align="right" width="25"><img src="/img/parteilogos/logo_' +partei_id+ '_20x10.gif" width=20 height=10 hspace=0 vspace=1 border=0></td>'+
	' <td align="right" width="60"><font size=-2>' +score+ '</font></td>'+
	'</tr>'+
	'</table>'

	document.writeln(t)
}

function HighscoreShowBottom ( uebersicht, archiv )
{
	t=
	'<table cellpadding=3 cellspacing=0 border=0 width="169">'+
	'<tr>'+
	'<td align=right class="standard"><font size=-2>'+
	'<a href="javascript:open_std_window(\'' +uebersicht+ '\', 400, 500);">&Uuml;bersicht...</a>'+
	( (archiv) ? '&nbsp;&nbsp;<a href="javascript:open_std_window(\'' +archiv+ '\', 420, 400);\">Archiv...</a>' : '')+
	'</font></td>'+
	'</tr>'+
	'</table>'

	document.writeln(t)
}


function HighscoreArchiveRow ( date , id , nickname , partei_id, score, file )
{
	bgc = (toggle == 1) ? '#ffffff' : '#f7f3f7'

	t=
	'<table cellpadding=3 cellspacing=0 border=0 width=380 bgcolor=' +bgc+ '>'+
	'<tr valign=top>'+
	' <td width=100><font size=-1>' +date+ '</font></td>'+
	' <td width=120><font size=-1>'+
	'    <a href=\"javascript:opener.location.href=\'../index.php3?position=1700&pid=' +id+ '\'; stop();\">' +nickname+ '</a>&nbsp;'+
	( (partei_id == 1) ? 'Volk' : '<img src="/img/parteilogos/logo_' +partei_id+ '_20x10.gif" width=20 height=10 hspace=0 vspace=1 border=0>' )+
	' </font></td>'+
	' <td width=80><font size=-1>' +score+ '</font></td>'+
	' <td width=80><font size=-1><a href="javascript:open_std_window2(\'archiv_details.php?file=' +file+ '\',380,320);">Details...</a></font></td>'+
	'</tr>'+
	'</table>'
	
	document.writeln(t)
	
	toggle = 1-toggle
}


function HighscoreArchiveDetails ( id , nickname , partei_id, score )
{
	bgc = (toggle == 1) ? '#ffffff' : '#f7f3f7'

	t=
	'<table cellpadding=3 cellspacing=0 border=0 width=300 bgcolor=' +bgc+ '>'+
	'<tr>'+
	' <td valign=top width=150><a href=\"javascript:opener.opener.location.href=\'../index.php3?position=1700&pid=' +id+ '\'; stop();\">' +nickname+ '</a></td>'+
	' <td valign=top width=50>'+
	( (partei_id == 1) ? 'Volk' : '<img src="/img/parteilogos/logo_' +partei_id+ '_20x10.gif" width=20 height=10 hspace=0 vspace=1 border=0>' )+
	'</td>'+
	' <td valign=top width=100 align=right>' +score+ '</td>'+
	'</tr>'+
	'</table>'

	document.writeln(t)
	
	toggle = 1-toggle
}
