function displayResults(dest) {
    top.frames["hiddenFrame"].location = dest;
}
function displayResultsInfo(sText) {
    var divResultsHere = document.getElementById("divResultsHere");
    divResultsHere.innerHTML = sText;
}
function doSubmit(thisform, thisoutput) {
    var forminfo = $(thisform).serialize();
    $(thisoutput).load( 'index.php?'+forminfo );
}
function bgChangeImage(target, bg) {
    document.getElementById(target).style.backgroundImage="url(" + bg + ")";
}
function setFocus(id) {
    var element = document.getElementById(id);
    if (element && element.focus) {
        element.focus();
    }
}
function appendtext(fromform, inputfield, outputform, outputfield) {
	var newtext = document.fromform.inputfield.value;
	document.form1.enclosures.value += newtext;
}
function swapSelectData(fromform, thisfield, outputfield) {
    var newtext = document.fromform.inputfield.value;
    document.getElementById(thisoutput).innerHTML = document.getElementById(newtext).innerHTML;
}
function goToURL(thisURL) {
    top.location = thisURL;
}
function loadURL(thisURL, thisoutput) {
    //var linkinfo = $(thisURL).serialize();
    $(thisoutput).load( 'index.php?'+thisURL );
}
function swapTabData(thistab, thisoutput) {
    document.getElementById(thisoutput).innerHTML = document.getElementById(thistab).innerHTML;
}
function popup(mylink, windowname) {
    if (! window.focus)return true;
    var href;
    if (typeof(mylink) == 'string')
       href=mylink;
    else
       href=mylink.href;
    window.open(href, windowname, 'width=850,height=600,scrollbars=yes');
    return false;
}
$(document).ready(function() {
    $(".formwindow").fancybox({
    	'height'			: '98%',
    	'autoScale'			: false,
    	'type'				: 'iframe'
    });
});
