

function OpenWindow(url, name, width, height) {
 windowReference = window.open(url, 'name','toolbar=no, menubar=no,scrollbars=no,resizable=no,status=no,location=no,directories=no,top=150, left=150,fullscreen=no,height='+height+', width='+width);
 windowReference.focus();
 if ( !windowReference.opener )

    { windowReference.opener = self; }
}

function autosubmit(theform)  {

    document.forms[theform].elements["g.otm.cgi.asm"].value=1;
    document.getElementById('progress').style.visibility='visible';
    // alert( document.forms[theform].elements["g.otm.cgi.asm"].value );

    document.forms[theform].submit();

}

function printPage() {

 window.print();

}


function popup_close_refresh(rsof)  {

if ( rsof == '' ) alert( "No ASF given for submit" )

    opener.document.forms[rsof].elements["g.otm.cgi.asm"].value=1;
    opener.document.forms[rsof].submit();

    window.close();

}

var newwindow = ''
function popup_pre( width, height )	{

	  newwindow=window.open('',"_blank","width="+width+",height="+height+",resizable=no");
	  newwindow.document.open();
	  newwindow.document.writeln('<html><head><title></title>');
	  newwindow.document.writeln('<style type="text/css">');
	  newwindow.document.writeln('<!--');
	  newwindow.document.writeln('body { margin-top:0px; margin-left:0px; overflow-x: hidden ; overflow-y: hidden;  }');
	  newwindow.document.writeln('//-->');
	  newwindow.document.writeln('</style>');
	  newwindow.document.writeln('</head>');
}

function popup_post()	{

	newwindow.document.writeln('</html>');
	newwindow.document.close();
}

function popup_youtube(id,width,height) {

	popup_pre( width,height );

	newwindow.document.writeln('<embed ');
//	newwindow.document.writeln('style="float:right;" hspace=10 ');
	newwindow.document.writeln('src="http://www.youtube.com/v/'+id+'&autoplay=1"');
	newwindow.document.writeln('type="application/x-shockwave-flash"');
	newwindow.document.writeln('wmode="transparent"');
	newwindow.document.writeln('width='+width+' height='+height+'>');
	newwindow.document.writeln('</embed>');
	popup_post();
}

function imgpopup(url,width,height) {

	popup_pre( width,height );

	newwindow.document.writeln('<body style="background-color:black;" onload="document.getElementById(\'text_patience\').style.display=\'none\'">');
//	newwindow.document.writeln('<body style="background-color:black;background-image:url('+url+');" onload="document.getElementById(\'text_patience\').style.display=\'none\'">');


	newwindow.document.writeln('<table width=100% height=100% cellspacing=0 cellpadding=0>');
	newwindow.document.writeln(' <tr>');
	newwindow.document.writeln('  <td>');
	newwindow.document.writeln('  <a href="javascript:window.close()">');
	newwindow.document.writeln('   <img border=0 src="'+url+'" width='+width+' height='+height+'>');
	newwindow.document.writeln('  </a>');
	newwindow.document.writeln('  </td>');
	newwindow.document.writeln(' </tr>');
	newwindow.document.writeln('</table>');
	newwindow.document.writeln('   <div style="position:fixed;right:24px;bottom:24px;" id="text_patience">');
	newwindow.document.writeln('   <font style="font-style:italic;background-color:black;color:white;">');
	newwindow.document.writeln('   <h2>Bild wird geladen ...</h2>');
	newwindow.document.writeln('   </font>');
	newwindow.document.writeln('   </div>');
	   
	newwindow.document.writeln('</body>');
	
	popup_post();
}

function toggle(element_name){
	
	var element_object=document.getElementById(element_name);

	if( !element_object ) {
  	
		return true;
		
	}else{

		if(element_object.style.display=="none"){

    		element_object.style.display="block"

		} else {

			element_object.style.display="none"

		}

		return true;
  
	}
}

function highlight(element_id) {

    var current_row=document.getElementById(element_id);

    if( !element_id ) {
	
	return true;
			
    }else{

	last_row_index=document.getElementById('row_remind_index').firstChild;
	last_row_class=document.getElementById('row_remind_class').firstChild;

	last_row_object=document.getElementById(last_row_index.nodeValue);


	if ( last_row_object ) {
	
	    last_row_object.className=last_row_class.nodeValue;
	}
	
	if ( last_row_index.nodeValue != element_id )	{

	    last_row_class.nodeValue=current_row.className;
	    last_row_index.nodeValue=element_id;
    	    current_row.className='list-selected';
	}

    }
				
}

function disableForm(form_name){
	
	objElements = document.forms[form_name].elements;

	for(i=0;i<objElements.length;i++) {

    	objElements[i].type="hidden";

	}

}
