// $Id: tools.js,v 1.5 2005/08/25 12:32:23 ckoehler Exp $

/**
 * Set search, sort and page values
 */
function submitPaging(page,sort)
{
    document.form.page.value = page;
    document.form.sort.value = sort;
	 document.form.method="post";
    document.form.submit(); 
}

function submitSort(sort)
{
    document.form.page.value = "1";
    document.form.sort.value = sort;
    document.form.submit(); 
}


function submitAction( action )
{
    document.form.action = action;
    document.form.submit(); 
}

function submitActionNoSort( action )
{
    document.form.sort.value = "";
    document.form.action = action;
    document.form.submit(); 
}

function openDocumentWindow(url)
{
    props = "locationbar=no, toolbar=no, resize=yes, scrollbar=yes";
    window.open (url, "", props);
}

function submitActionTarget( action, target )
{
    var jetzt = new Date();
    var ms = jetzt.getTime();
	// no timestamp!
    //action = action + "&s=" + ms;
    document.form.action = action;
    document.form.target = target;
    document.form.submit(); 
}


// open a PopupWindow
function openPopupWindow(url)
{
    props = "width=500, height=320, resizable=yes, scrollbars=yes";
    window.open (url, "", props);
}

function openPopupPictureWindow(url, h, w)
{
    props = "height=" + h + ", width=" + w + ", resizable=yes, scrollbars=auto";
    window.open (url, "", props);
}


function toggleMyView(myVariable, myURL)
{
	document.toggleForm.action = myURL;
	document.toggleForm.toggleView.value = myVariable ;
	document.toggleForm.submit();
}
