﻿var pnl_visitor_id = 'pnl_visitor';

function visitor_in(pnl_id){
    //alert(b_id);
    pnl_visitor_id = pnl_id;
    setTimeout("animation_play('bae_visitor_in');", 1000);
}
        
function animation_play(b_id){
    //alert(b_id);
    try{
        $find(b_id).get_OnClickBehavior().get_animation().play();
    }
    catch (e){
        alert(b_id);
    }    
}
        
function pnl_visitor_move_to_center(){
    var wWidth = 0, wHeight = 0;
            
    if (typeof(window.innerWidth) == 'number'){
        //Non-IE
        wWidth = window.innerWidth;
        wHeight = window.innerHeight;
    } 
    else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
        //IE 6+ in 'standards compliant mode'
        wWidth = document.documentElement.clientWidth;
        wHeight = document.documentElement.clientHeight;
    } 
    else if (document.body && (document.body.clientWidth || document.body.clientHeight)){
        //IE 4 compatible
        wWidth = document.body.clientWidth;
        wHeight = document.body.clientHeight;
    }

    var pnl = $get(pnl_visitor_id);
    pnl.style.left = (wWidth / 2) - (pnl.offsetWidth / 2);
    pnl.style.top = (wHeight / 2) - (pnl.offsetHeight / 2);
}

function visitor_submit_click(){
    if (!Page_ClientValidate('form_visitor')) return false;
    animation_play('bae_visitor_switch');
    return false;
}
