/*sort columns*/
function setOrder(column)
{
    cfield=document.getElementById('orderby');
    ovalue=cfield.value;
    if(ovalue==column){
        if(document.getElementById('orderdir').value=='asc')
            {document.getElementById('orderdir').value='desc';}
        else{document.getElementById('orderdir').value='asc';}
        }
    else{cfield.value=column;}
    cfield.form.submit();
    
 }
/* print functions */



function checkAll( object )
{
    var newStatus = object.checked;
    var allInputs = document.getElementsByName('printCheck[]');
    for ( var i = 0; i < allInputs.length; i++ )
    {
        allInputs[i].checked = newStatus;
    }
    return true;
}


function printSelected()
{
	var counter=0;
	var selected=document.getElementsByName('printCheck[]');
    for ( var i = 0; i < selected.length; i++ )
    {
        if(selected[i].checked == true){counter++;}
    }
    if(counter == 0){
        for ( i = 0; i < selected.length; i++ )
        {
            selected[i].checked = true;
        }
    }
	var a=document.getElementById('printForm');
	a.submit(); 
}

function fixGoogleCoypright() {
    // Fix Google copyright text.
    setTimeout('$("#logocontrol + div").css("white-space", "normal")', 300);
    // Fix again, if it took Google a bit longer to serve the map.
    setTimeout('$("#logocontrol + div").css("white-space", "normal")', 1000);
    // And again for realy slow connections.
    setTimeout('$("#logocontrol + div").css("white-space", "normal")', 3000);
}

/*Neuer User*/
function openNeueintrag(url)
{
	var neuEintragUrl = url;
	var availHeight = screen.availHeight - 80;
	var openingOptions = 'dependent=yes,left=10,top=10,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no';
	openingOptions += ',width=550,height=' + availHeight;
	var newWindow = window.open( neuEintragUrl, 'Neueintrag', openingOptions );
	newWindow.focus();
	return(false);
}
/* Videolinks*/
function openVideo (url) {
	  myWindow = window.open(url, "Videolink", "width=680,height=590,left=100,top=200");
	  myWindow.focus();
	}
function openBmoVideo (url) {
	myWindow = window.open(url, "Videolink", "width=420,height=570,left=100,top=200");
	myWindow.focus();
}

function openUrlScroll (url,name,width,height,left,top) {
	  var params = "scrollbars=yes,width="+width+",height="+height+",left="+left+",top="+top;
	  myWindow = window.open(url, name, params);
	  myWindow.focus();
}

function openUrl (url,name,width,height,left,top) {
	  var params = "width="+width+",height="+height+",left="+left+",top="+top;
	  myWindow = window.open(url, name, params);
	  myWindow.focus();
}
