
function show_site(){
win = new Window('window_id', {className: "dialog", url: "/", title: "Просмотр сайта (http://frr.com.ua)", width:750, height:500}); 
win.setDestroyOnClose(); 
win.showCenter(); 
}

function show_ask(){
raver = new Dialog.info({url: "/site/ask", options: {method: 'get'}}, {className: "alphacube", width:471, height:246});
}



function check_fields(){

tar1 = document.getElementById("sname");
tar2 = document.getElementById("semail");
tar3 = document.getElementById("stext");

if(tar1.value == ""){
tar1.style.border="1px solid #ff1900"; 
v1 = "no";
}else{
v1 = "ok";
tar1.style.border="1px solid #191919"; 
}

if(tar2.value == ""){
tar2.style.border="1px solid #ff1900"; 
v2 = "no";
}else{
v2 = "ok";
tar2.style.border="1px solid #191919"; 
}

if(tar3.value == ""){
tar3.style.border="1px solid #ff1900"; 
v3 = "no";
}else{
v3 = "ok";
tar3.style.border="1px solid #191919"; 
}

if(v1 == "ok" && v2 == "ok" && v3 == "ok"){
ask_call(tar1.value, tar2.value, tar3.value);
}


}


function ask_call(sname, semail, stext){

new Ajax.Request('/site/ask_call',
  {
    method:'get',
    parameters: {name: sname, email: semail, text: stext},
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
//        alert(response);
      progres.style.visibility = "hidden";

        document.getElementById("tab1").style.display = "none";
        document.getElementById("tab2").style.display = "";

      window.setTimeout("Dialog.okCallback()",2000);

    },
    onFailure: function(){ alert('Не могу соеденится с сервером') }
  });

target2 = document.getElementById("progres");
target2.style.visibility = 'visible';


}



/*
win = new Window('window_id', {className: "alphacube", url: "/site/ask", title: "", width:540, height:300, closable:false, minimizable:false, maximizable:false, resizable:false, draggable:false}); 
win.setDestroyOnClose(); 
win.showCenter(); 

function show_site(){
}
*/