function focusE(element){
    $(element).focus();
    return false;
}

function onSubmitCheck(){
    showProcessing();
    return true;
}

function showOverlay(){
    $('overlay').show();
    center('overlay_white');
    $('overlay_big_picture').show();
    $('overlay_thumbs').show();
    $('overlay_close').show();    
    return false;
}  

function hideOverlay() {
    $('overlay_close').hide();
    $('overlay_thumbs').hide();
    $('overlay_big_picture').hide();
    $('overlay_white').hide();
    $('overlay').hide();
    //reload the flash file
    //loadFlash(region);
    return false;
}

function center(element){
    try{
        element = $(element);
    }catch(e){
        return;
    }

    var my_width  = 0;
    var my_height = 0;

    if ( typeof( window.innerWidth ) == 'number' ){
        my_width  = window.innerWidth;
        my_height = window.innerHeight;
    }else if ( document.documentElement && 
             ( document.documentElement.clientWidth ||
               document.documentElement.clientHeight ) ){
        my_width  = document.documentElement.clientWidth;
        my_height = document.documentElement.clientHeight;
    }
    else if ( document.body && 
            ( document.body.clientWidth || document.body.clientHeight ) ){
        my_width  = document.body.clientWidth;
        my_height = document.body.clientHeight;
    }

    element.style.position = 'absolute';
    element.style.zIndex   = 99;

    var scrollY = 0;

    if ( document.documentElement && document.documentElement.scrollTop ){
        scrollY = document.documentElement.scrollTop;
    }else if ( document.body && document.body.scrollTop ){
        scrollY = document.body.scrollTop;
    }else if ( window.pageYOffset ){
        scrollY = window.pageYOffset;
    }else if ( window.scrollY ){
        scrollY = window.scrollY;
    }

    var elementDimensions = Element.getDimensions(element);

    var setX = ( my_width  - elementDimensions.width  ) / 2;
    var setY = ( my_height - elementDimensions.height ) / 2 + scrollY;

    setX = ( setX < 0 ) ? 0 : setX;
    setY = ( setY < 0 ) ? 0 : setY;

    element.style.left = setX + "px";
    element.style.top  = setY + "px";

    element.style.display  = 'block';
}
function loadFlash(queryString)
{/*           
    var flashObjStr = "<object id='Object1' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0'height='292px'><param name='movie' value='flash/" + queryString + ".swf' /><param name='quality' value='high' /><embed src='flash/" + queryString + ".swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' height='292px'></embed></object>";
    
    document.getElementById('pictures').innerHTML = flashObjStr;  */          
}

