// Standardfunctions für portal

function _get_select(o) {

for (i=0;i<o.length;i++) {
        if (o[i].selected==true) {
        wert=o[i].value;
        break;
        }
}
return (wert);
} // ende funtion

function _set_select(o,wert) {
for (i=0;i<o.length;i++) {
        if (o[i].value==wert) {
        o[i].selected=true;
        break;
        }
}
} // ende funtion

function _get_mselect(o) {
string="";

for (i=0;i<o.length;i++) {
        if (o[i].selected==true) {
        wert=o[i].value;
		string=string+":"+wert;
        }
}
return (string);
} // ende funtion


function _get_checked(c) {

if (c.checked==true) {
wert=1;
} else {
wert=0;
}
return (wert);
} // ende funtion

function _set_checked(c,wert) {

if (wert==1) {
c.checked=true;
} else {
c.checked=false;
}
return;
}

function _get_radio(c) {
wert="";
for (i=0;i<c.length;i++) {
	if (c[i].checked==true) {
	wert=c[i].value;
	break;
	}
} // next

return (wert);
} // ende funtion

function StatusText(Text)
{
 if(window.statusbar && window.statusbar.visible == true) window.defaultStatus = Text;
 else alert(Text);
}

function hauspost() {
url="p6900.php?init=frame";
windowparameter="width=800,height=500,menubar=no,locationbar=no,toolbar=no,scrollbars=yes,status=yes,resizable=yes";
anzeige="user_online";
        anzeige = window.open(url,
        anzeige,windowparameter);
        anzeige.focus();

}

function pinwand_eintrag() {
url="pinwand.php";
windowparameter="width=400,height=300,menubar=no,locationbar=no,toolbar=no,scrollbars=yes,status=yes,resizable=yes";
anzeige="pinwand";
        anzeige = window.open(url,
        anzeige,windowparameter);
        anzeige.focus();

}

function innerHTMLjs(obj,text) {
// der text wird ohne \n dafür mit <BR /> übergeben
// obj hat die Struktur top.oben.document.getElementById("_id");
while (text.search("<br>") != -1) {
text=text.replace(/<br>/,"\n");
}
while (text.search("<br />") != -1) {
text=text.replace(/<br \/>/,"\n");
}
while (text.search("<BR>") != -1) {
text=text.replace(/<BR>/,"\n");
}
while (text.search("<BR />") != -1) {
text=text.replace(/<BR \/>/,"\n");
}
obj.innerHTML=text;
}

function myescape(string) {
//alert(string);

string=escape(string);
string=string.replace('+','%2B');
//alert(string);
return (string);
}

function url2pdf(url) {
url="url2pdf.php?filename="+url;
anzeige="PDF_Druckvorschau";

        if (windowparameter=="") {
        ph=top.windowparameter_height;
        pw=top.windowparameter_width;
        default_wp="width="+pw+",height="+ph+",menubar=no,locationbar=no,toolbar=no,scrollbars=yes,status=yes,resizable=yes";
        }


        if (url!="") {
                if (windowparameter=="") {
                windowparameter=default_wp;
                }
        anzeige = window.open(url,
        anzeige,windowparameter);
        anzeige.focus();

        }

} // ende function showme
