    function winopen( url ) {
        window.open( url );
    }

function toggleTable( part, h )
{

        ul =    document.getElementById('tbody_'+part);

        if(ul.style.display == 'none') {

                ul.style.display = '';

                createCookie( "tbody_"+part, "0" );

        } else {
                ul.style.display = 'none';

                createCookie( "tbody_"+part, "1" );

        }
}
function initTable( part )
{

        ul =    document.getElementById('tbody_'+part);

        if(readCookie("tbody_"+part) != '1') {

                ul.style.display = '';

        } else {
                ul.style.display = 'none';

        }
}

function createCookie(name,value) {

        document.cookie = name+"="+value+";";
}

function readCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1,c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
}

function eraseCookie(name) {
        createCookie(name,"",-1);
}


function input_sm(FORM, ELEMENT, SM) {
	document.forms[FORM].elements[ELEMENT].value += " *"+SM+"* ";
	document.forms[FORM].elements[ELEMENT].focus();
}

function input_sm2(FORM, ELEMENT, SM) {
	document.forms[FORM].elements[ELEMENT].value += " "+SM+" ";
	document.forms[FORM].elements[ELEMENT].focus();
}


function go_galerie(polo) {
	if(polo == '--')
		document.location='/';
        else
		document.location='/html/galerie/polo/'+polo+',1.html';
}

function openbudwin() {
        window.open('/data/popup/buddy.php?<?=session_id();?>','polobudWin','width=320,height=200,resizeable=no,scrollbars=yes');
}
function opennewemailwin() {
        window.open('/data/popup/newemail.php','polobudWin','width=400,height=100,resizeable=no,scrollbars=yes');
}


function xsXL(image){
if (navigator.appName=="Netscape")
browserWidth = self.innerWidth;
if (navigator.appName.indexOf("Microsoft")!=-1)
browserWidth = document.body.offsetWidth;
  
if (image.width>(browserWidth-50)) {
realWidth = image.width; // save real width for later use
image.style.cursor = "crosshair"; // cursor modification
image.width=(browserWidth-50);
}
else if (image.width==(browserWidth-50)) {
image.width=realWidth; // image is scaled already, go back to real width
}
}

function insert(aTag, eTag) {
	aTag = ' '+aTag;
	eTag = eTag+' ';
  var input = document.forms['form'].elements['text'];
  input.focus();
  /* für Internet Explorer */
  if(typeof document.selection != 'undefined') {
    /* Einfügen des Formatierungscodes */
    var range = document.selection.createRange();
    var insText = range.text;
    range.text = aTag + insText + eTag;
    /* Anpassen der Cursorposition */
    range = document.selection.createRange();
    if (insText.length == 0) {
      range.move('character', -eTag.length);
    } else {
      range.moveStart('character', aTag.length + insText.length + eTag.length);      
    }
    range.select();
  }
  /* für neuere auf Gecko basierende Browser */
  else if(typeof input.selectionStart != 'undefined')
  {
    /* Einfügen des Formatierungscodes */
    var start = input.selectionStart;
    var end = input.selectionEnd;
    var insText = input.value.substring(start, end);
    input.value = input.value.substr(0, start) + aTag + insText + eTag + input.value.substr(end);
    /* Anpassen der Cursorposition */
    var pos;
    if (insText.length == 0) {
      pos = start + aTag.length;
    } else {
      pos = start + aTag.length + insText.length + eTag.length;
    }
    input.selectionStart = pos;
    input.selectionEnd = pos;
  }
  /* für die übrigen Browser */
  else
  {
    /* Abfrage der Einfügeposition */
    var pos;
    var re = new RegExp('^[0-9]{0,3}$');
    while(!re.test(pos)) {
      pos = prompt("Einfügen an Position (0.." + input.value.length + "):", "0");
    }
    if(pos > input.value.length) {
      pos = input.value.length;
    }
    /* Einfügen des Formatierungscodes */
    var insText = prompt("Bitte geben Sie den zu formatierenden Text ein:");
    input.value = input.value.substr(0, pos) + aTag + insText + eTag + input.value.substr(pos);
  }
}




function ShowHide2(id) {
    obj = document.getElementsByTagName("div");
    if (obj[id].style.display == 'block'){
    obj[id].style.display = 'none';
    }
    else {
         obj[id].style.display = 'block';

    }
}



