var loc1opened=0;
var loc2opened=0;
var loc3opened=0;
var loc4opened=0;
var loc5opened=0;
var loc6opened=0;

function getBrowserInfo() {
 var t,v = undefined;
 if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}
 
function bookmark(a){
 var url = window.document.location;
 var title = window.document.title;
 var b = getBrowserInfo();
 if (b.type == 'IE' && b.version >= 4) window.external.AddFavorite(url,title);
 else if (b.type == 'Opera') {
  a.href = url;
  a.rel = "sidebar";
  a.title = url+','+title;
  return true;
 }
 else if (b.type == "Netscape") window.sidebar.addPanel(title,url,"");
 else alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
 return false;
}


function officeOver(){
document.getElementById("office").src='/img/office_.gif';
}

function officeOut(){
document.getElementById("office").src='/img/office.gif';
}


function showMenu(id,all){
var nono=0;
for (ii=0;ii<all;ii++){
var h=parseInt(document.getElementById("sbmenu["+ii+"]").style.height);
if (isNaN(h)){var h=parseInt(document.getElementById("submenu["+ii+"]").offsetHeight);document.getElementById("sbmenu["+ii+"]").style.height=h;}
if (h>1){
if (id!=ii){
document.getElementById("menu["+ii+"]").className="passMenu";
setTimeout("closeMenu("+ii+")",1);
} else{var nono=1;}
}
}
if (nono==0){
document.getElementById("menu["+id+"]").className="actMenu";
setTimeout("openMenu("+id+")",1);
}
}


function openMenu(id){
var h=parseInt(document.getElementById("sbmenu["+id+"]").style.height);
var h2=parseInt(document.getElementById("submenu["+id+"]").offsetHeight);
if (h<h2){
h=h+10;
if (h>h2){h=h2;}
document.getElementById("sbmenu["+id+"]").style.height=h;
setTimeout("openMenu("+id+")",1);
}
}

function closeMenu(id){
var h=parseInt(document.getElementById("sbmenu["+id+"]").style.height);
if (h>1){
h=h-10;
if (h<1){h=1;}
document.getElementById("sbmenu["+id+"]").style.height=h;
setTimeout("closeMenu("+id+")",1);
}
}



function showAnons(id,all){

var nono=0;
for (ii=0;ii<all;ii++){
var h=parseInt(document.getElementById("anons_cnt["+ii+"]").style.height);
if (h>1){
if (id!=ii){
document.getElementById("brief["+ii+"]").className="showall";
//document.getElementById("anons["+ii+"]").className="shownone";
setTimeout("closeLayer("+ii+")",1);
} else{var nono=1;}
}
}
if (nono==0){
document.getElementById("brief["+id+"]").className="shownone";
document.getElementById("anons["+id+"]").className="showall";
setTimeout("openLayer("+id+")",1);
}
}

function openLayer(id){
var h=parseInt(document.getElementById("anons_cnt["+id+"]").style.height);
var h2=parseInt(document.getElementById("anons_real["+id+"]").offsetHeight);
if (h<h2){
h=h+10;
if (h>h2){h=h2;}
document.getElementById("anons_cnt["+id+"]").style.height=h;
setTimeout("openLayer("+id+")",1);
}
}


function closeLayer(id){
var h=parseInt(document.getElementById("anons_cnt["+id+"]").style.height);
if (h>1){
h=h-20;
if (h<1){h=1;}
document.getElementById("anons_cnt["+id+"]").style.height=h;
setTimeout("closeLayer("+id+")",1);
}
}

function mainPage(id){
document.location="/?id="+id;
}

function tourPage(){
document.location="/travel/";
}

function switchForm(id){

if (id==4){
document.getElementById("bookPanel").style.height="353px";
document.getElementById("iengine["+id+"]").className="showall";
document.getElementById("switch["+id+"]").className="active";
document.getElementById("iicon["+id+"]").className="icon"+id+"_";
if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
document.getElementById("switch["+id+"]").runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/active.png',sizingMethod='crop')";
}
}
else{
document.getElementById("bookPanel").style.height="333px";
for (ii=1;ii<4;ii++){
if (ii==id){
document.getElementById("iengine["+ii+"]").className="showall";
document.getElementById("switch["+ii+"]").className="active";
document.getElementById("iicon["+ii+"]").className="icon"+ii+"_";
if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
document.getElementById("switch["+ii+"]").runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/active.png',sizingMethod='crop')";
}
}
else{
document.getElementById("iengine["+ii+"]").className="shownone";
document.getElementById("switch["+ii+"]").className="passive";
document.getElementById("iicon["+ii+"]").className="icon"+ii;
if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
document.getElementById("switch["+ii+"]").runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/passive.png',sizingMethod='crop')";
}
}
}
}
}


function changeSides(){
if (
document.getElementById("isboth").checked==true){document.getElementById("manysides").className="bothsides";
if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
document.getElementById("manysides").runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/sides.png',sizingMethod='crop')";
}
}
else{
document.getElementById("manysides").className="oneside";
if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
document.getElementById("manysides").runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/oneside.png',sizingMethod='crop')";
}
}
}


function changeSides2(){
if (
document.getElementById("isboth2").checked==true){document.getElementById("manysides2").className="bothsides";
if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
document.getElementById("manysides2").runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/sides.png',sizingMethod='crop')";
}
}
else{
document.getElementById("manysides2").className="oneside";
if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
document.getElementById("manysides2").runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/oneside.png',sizingMethod='crop')";
}
}
}


function getAuto(str,id){
if (str.length>2){
var req = getXmlHttp();

req.onreadystatechange = function() {  
// onreadystatechange активируется при получении ответа сервера
if (req.readyState == 4) { 
// если запрос закончил выполняться
//statusElem.innerHTML = req.statusText // показать статус (Not Found, ОК..)
if(req.status == 200) { 
// если статус 200 (ОК) - выдать ответ пользователю
document.getElementById("loc"+id).innerHTML=req.responseText;
if (req.responseText.length>0){
if (id==1){document.getElementById("loc"+id).className="loc";}
else{document.getElementById("loc"+id).className="loc_";}
if (id==1){loc1opened=1;}
if (id==2){loc2opened=1;}
setTimeout("locOpenState("+id+")",5);
}
else{
document.getElementById("loc"+id).className="shownone";
}
}
// тут можно добавить else с обработкой ошибок запроса
}
}
// (3) задать адрес подключения
req.open('GET', '/getAuto.php?str='+encodeURI(str)+"&id="+id, true);  

// объект запроса подготовлен: указан адрес и создана функция onreadystatechange
// для обработки ответа сервера
// (4)
req.send(null);  // отослать запрос
}
else{
document.getElementById("loc"+id).className="shownone";
}
}

function getAuto_sirena(str,id){
var req = getXmlHttp();

req.onreadystatechange = function() {  
// onreadystatechange активируется при получении ответа сервера
if (req.readyState == 4) { 
// если запрос закончил выполняться
//statusElem.innerHTML = req.statusText // показать статус (Not Found, ОК..)
if(req.status == 200) { 
// если статус 200 (ОК) - выдать ответ пользователю
document.getElementById("loc"+id).innerHTML=req.responseText;
if (req.responseText.length>0){
if (id==3){document.getElementById("loc"+id).className="loc";}
else{document.getElementById("loc"+id).className="loc_";}
if (id==3){loc3opened=1;}
if (id==4){loc4opened=1;}
setTimeout("locOpenState("+id+")",5);
}
else{
document.getElementById("loc"+id).className="shownone";
}
}
// тут можно добавить else с обработкой ошибок запроса
}
}
// (3) задать адрес подключения
req.open('GET', '/getAuto_sirena.php?str='+encodeURI(str)+"&id="+id, true);  

// объект запроса подготовлен: указан адрес и создана функция onreadystatechange
// для обработки ответа сервера
// (4)
req.send(null);  // отослать запрос
}


function getAuto_zhd(str,id){
var req = getXmlHttp();

req.onreadystatechange = function() {  
// onreadystatechange активируется при получении ответа сервера
if (req.readyState == 4) { 
// если запрос закончил выполняться
//statusElem.innerHTML = req.statusText // показать статус (Not Found, ОК..)
if(req.status == 200) { 
// если статус 200 (ОК) - выдать ответ пользователю
document.getElementById("loc"+id).innerHTML=req.responseText;
if (req.responseText.length>0){
document.getElementById("loc"+id).className="loc";
if (id==5){loc5opened=1;}
if (id==6){loc6opened=1;}
setTimeout("locOpenState("+id+")",5);
}
else{
document.getElementById("loc"+id).className="shownone";
}
}
// тут можно добавить else с обработкой ошибок запроса
}
}
// (3) задать адрес подключения
req.open('GET', '/getAuto_zhd.php?str='+encodeURI(str)+"&id="+id, true);  

// объект запроса подготовлен: указан адрес и создана функция onreadystatechange
// для обработки ответа сервера
// (4)
req.send(null);  // отослать запрос
}



function vote(opros){
for (zz=0;zz<document.getElementsByName("yourvote"+opros).length;zz++){
if (document.getElementsByName("yourvote"+opros)[zz].checked==true){var answer=document.getElementsByName("yourvote"+opros)[zz].value;}
}
var req = getXmlHttp();
req.onreadystatechange = function() {  
if (req.readyState == 4) { 
if(req.status == 200) { 
if (req.responseText.length>0){
document.getElementById("opbutton"+opros).innerHTML="<table cellspacing=0 cellpadding=0 border=0><td valign=center class=price style='padding-left:10px;padding-top:10px;'>Благодарим Вас за участие в нашем опросе.<br>Ваше мнение очень важно для нас.</td></table>";
//setTimeout("redrawLine("+opros+","+answer+")",1000);
}
}
}
}
req.open('GET', '/oprosAnswer.php?opros='+opros+'&answer='+answer, true);  
req.send(null);  // отослать запрос
}


function voteMultiple(opros){
for (zz=0;zz<document.getElementsByName("yourvote"+opros).length;zz++){
if (document.getElementsByName("yourvote"+opros)[zz].checked==true){var answer=document.getElementsByName("yourvote"+opros)[zz].value;}
}
var req = getXmlHttp();
req.onreadystatechange = function() {  
if (req.readyState == 4) { 
if(req.status == 200) { 
if (req.responseText.length>0){
document.getElementById("opbutton"+opros).innerHTML='<table cellspacing=0 cellpadding=0 border=0><td valign=center style="padding-right:6px;padding-top:10px;"><img src=/img/ajax.gif width=30 height=30></td><td valign=center class=price style="padding-left:10px;padding-top:10px;">Благодарим Вас за участие в нашем опросе.<br>Ваше мнение очень важно для нас.</td></table>';
var bz=req.responseText;
setTimeout("hideOpros("+opros+","+bz+")",2000);
}
}
}
}
req.open('GET', '/oprosAnswer.php?opros='+opros+'&answer='+answer, true);  
req.send(null);  // отослать запрос
}


function hideOpros(opros,bz){
document.getElementById("myopros"+opros).className="shownone";
if (bz==1){
document.getElementById("oprosContent").innerHTML='<div style="padding-top:40px;padding-left:20px;"><table cellspacing=0 cellpadding=0 border=0 width=90%><td valign=top class=pictop><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=picleft><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=picbottom><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=picright><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=piclt><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=picrt><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=picrb><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=piclb style="padding:40px;"><div>Благодарим Вас за участие в опросах.</div><div style="padding-top:10px;">На текущий момент активных опросов больше нет.</div></td></table></td></table></td></table></td></table></td></table></td></table></td></table></td></table></div>';
}
}



function waitSubscriber(){
document.getElementById("myok").innerHTML='<div style="padding-left:6px;padding-right:6px;"><img src=/img/ajax.gif width=30 height=30></div>';
setTimeout("newSubscriber()",500);
}


function sendQuestion(){
document.getElementById("quesResult").innerHTML='<table cellspacing=0 cellpadding=0 border=0><td valign=top><div style="padding-left:6px;padding-right:6px;"><img src=/img/ajax.gif width=30 height=30></div></td><td class=price>идет отправка вопроса</td></table>';
setTimeout("sendRealQuestion()",500);
}

function sendRealQuestion(){
if (document.getElementById("yourmail").value=='' || document.getElementById("yourfio").value=='' || document.getElementById("yourques").value=='' || document.getElementById("yourcode").value==''){
document.getElementById("quesResult").innerHTML='<div><img src=/img/sendques.gif border=0 style="cursor:hand;cursor:pointer;" onclick=sendQuestion();></div><div class=cpr_ style="padding-top:10px;padding-right:13px;">Не заполнены все необходимые поля.</div>';
}
else{
var req = getXmlHttp();
req.onreadystatechange = function() {  
if (req.readyState == 4) { 
if(req.status == 200) {
if (req.responseText==2){document.getElementById("quesResult").innerHTML='<div><img src=/img/sendques.gif border=0 style="cursor:hand;cursor:pointer;" onclick=sendQuestion();></div><div class=cpr_ style="padding-top:10px;padding-right:13px;">Неверно указан код защиты от спама.</div>';}
if (req.responseText==1){document.getElementById("quesContent").innerHTML='Спасибо! Ваш вопрос успешно отправлен.<br><br>В ближайшее время наши специалисты обязательно на него ответят.<br><br>Ответ будет  отправлен на указанный Вами адрес электронной почты.';}
}
}
}
req.open('GET', '/sendQuestion.php?yourfio='+encodeURI(document.getElementById("yourfio").value)+'&yourmail='+encodeURI(document.getElementById("yourmail").value)+'&yourques='+encodeURI(document.getElementById("yourques").value)+'&yourcode='+encodeURI(document.getElementById("yourcode").value), true);  
req.send(null);  // отослать запрос
}
}




function newSubscriber(){
if (document.getElementById("myemail").value==''){
document.getElementById("myok").innerHTML='<img src=/img/ok.gif border=0 style="cursor:hand;cursor:pointer;" width=42 height=30 onclick=waitSubscriber();>';
document.getElementById("mymess").className="showall";
}
else{
var req = getXmlHttp();
req.onreadystatechange = function() {  
if (req.readyState == 4) { 
if(req.status == 200) {
document.getElementById("mysubscribe").innerHTML=req.responseText;
}
}
}
req.open('GET', '/subscribe.php?mailer='+encodeURI(document.getElementById("myemail").value), true);  
req.send(null);  // отослать запрос
}
}



function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}

function doSub(city,id){
if(id==1){document.getElementById("B_LOCATION_1").value=city;}
if(id==2){document.getElementById("E_LOCATION_1").value=city;}
if(id==3){document.getElementById("origin-city-name").value=city;}
if(id==4){document.getElementById("destination-city-name").value=city;}
if(id==5){document.getElementById("from").value=city;}
if(id==6){document.getElementById("to").value=city;}
document.getElementById("loc"+id).className="shownone";
}


function closeFunction(){
if (loc1opened==2){document.getElementById("loc1").className = "shownone"; loc1opened=0;}
if (loc2opened==2){document.getElementById("loc2").className = "shownone"; loc2opened=0;}
if (loc3opened==2){document.getElementById("loc3").className = "shownone"; loc3opened=0;}
if (loc4opened==2){document.getElementById("loc4").className = "shownone"; loc4opened=0;}
if (loc5opened==2){document.getElementById("loc5").className = "shownone"; loc5opened=0;}
if (loc6opened==2){document.getElementById("loc6").className = "shownone"; loc6opened=0;}
}

function locOpenState(id){
if(id==1){loc1opened=2;}
if(id==2){loc2opened=2;}
if(id==3){loc3opened=2;}
if(id==4){loc4opened=2;}
if(id==5){loc5opened=2;}
if(id==6){loc6opened=2;}
}

function ShowQHelp(url){
hei=((screen.height-450)/2-30);wid=((screen.width-800)/2);
window.open(url,"mapp","width=800,height=450,screenX=0,screenY=0,left="+wid+",top="+hei+",scrollbars=yes");
}

function goScroll(){
var hiter = document.getElementById("inbn").rows[0].cells.length;
if (hiter>1){
setTimeout("scrollBn()",2500);
}
}

function scrollBn(){
var currentTop=document.getElementById("bnset").scrollLeft+574;
var hiter = document.getElementById("inbn").rows[0].cells.length;
setTimeout("RealScrollBn("+currentTop+")",1);
}

function RealScrollBn(currentLeft){
if (document.getElementById("bnset").scrollLeft<currentLeft){
document.getElementById("bnset").scrollLeft=document.getElementById("bnset").scrollLeft+16;
setTimeout("RealScrollBn("+currentLeft+")",1);
}
else{
var inbn=document.getElementById("inbn");
var oldHTML=inbn.rows[0].cells[0].innerHTML;
inbn.rows[0].deleteCell(0);
document.getElementById("bnset").scrollLeft=0;
var hiter = document.getElementById("inbn").rows[0].cells.length;
inbn.rows[0].insertCell(hiter).innerHTML=oldHTML;
setTimeout("goScroll()",1);
}
}

function showSelect(id){
if (id==1){
document.getElementById("countries").className="shownone";
document.getElementById("airports").className="shownone";
document.getElementById("companies").className="showall";
}
if (id==2){
document.getElementById("airports").className="shownone";
document.getElementById("companies").className="shownone";
document.getElementById("countries").className="showall";
}
if (id==3){
document.getElementById("countries").className="shownone";
document.getElementById("companies").className="shownone";
document.getElementById("airports").className="showall";
}
}

function showLayer(layer){
document.getElementById("dques"+layer).style.color="#FFAA01";
var h3=parseInt(document.getElementById("llayer"+layer).style.height);
if (h3==1){setTimeout("openLayer("+layer+")",1);}
else{setTimeout("closeLayer("+layer+")",1);}
}

function openLayer(layer){
var h=parseInt(document.getElementById("llayer"+layer).style.height);
var h2=parseInt(document.getElementById("layer"+layer).offsetHeight);
if (h<h2){
h=h+20;
if (h>h2){h=h2;}
document.getElementById("llayer"+layer).style.height=h;
setTimeout("openLayer("+layer+")",1);
}
}

function closeLayer(layer){
document.getElementById("dques"+layer).style.color="#327CA3";
var h=parseInt(document.getElementById("llayer"+layer).style.height);
if (h>1){
h=h-20;
if (h<1){h=1;}
document.getElementById("llayer"+layer).style.height=h;
setTimeout("closeLayer("+layer+")",1);
}
}


function checkFrameSize(){
document.getElementById("thisframe").style.height=document.getElementById("thisframe").document.body.offsetHeight;
setTimeout("checkFrameSize()",500);
}

function showAllTours(){
document.getElementById("thisframe").style.height=window.frames["thisframe"].document.body.scrollHeight;
document.getElementById("alltours").className="shownone";
}

function setToursHeight(){
if (window.frames["thisframe"].document.body.scrollHeight>1180){
document.getElementById("thisframe").style.height=1164;
document.getElementById("alltours").className="showall";
}
else{
document.getElementById("thisframe").style.height=window.frames["thisframe"].document.body.scrollHeight;
document.getElementById("alltours").className="shownone";
}
}


function showAllTours2(){
document.getElementById("thisframe2").style.height=window.frames["thisframe2"].document.body.scrollHeight;
document.getElementById("alltours2").className="shownone";
}

function setToursHeight2(){
if (window.frames["thisframe2"].document.body.scrollHeight>680){
document.getElementById("thisframe2").style.height=664;
document.getElementById("alltours2").className="showall";
}
else{
var realHeight=window.frames["thisframe2"].document.body.scrollHeight;
document.getElementById("thisframe2").style.height="1px";
document.getElementById("thisframe2").style.height=realHeight;
document.getElementById("alltours2").className="shownone";
}
}

function checkTables(){
if (document.body.clientWidth>1700){
if (document.getElementById("tblBig")){
document.getElementById("tblBig").style.backgroundColor="#CCCCCC";
document.getElementById("tbl_Big").className="tblCorr";
}
document.getElementById("tbl_head").className="tblCorrect";
document.getElementById("tbl_middle").className="tblCorrect";
document.getElementById("tbl_bottom").className="tblCorrect";
document.getElementById("tbl_foot").className="tblCorrect";
document.getElementById("tbl_main").className="tblCorrect";
document.getElementById("tbl_main2").className="tblCorrect";
}
else{
if (document.body.clientWidth>1500){
if (document.getElementById("tblBig")){
document.getElementById("tblBig").style.backgroundColor="#FFFFFF";
document.getElementById("tbl_Big").className="tblCorr_";
}
document.getElementById("tbl_head").className="tblCor";
document.getElementById("tbl_middle").className="tblCor";
document.getElementById("tbl_bottom").className="tblCor";
document.getElementById("tbl_foot").className="tblCor";
document.getElementById("tbl_main").className="tblCor";
document.getElementById("tbl_main2").className="tblCor";
}
else{
if (document.getElementById("tblBig")){
document.getElementById("tblBig").style.backgroundColor="#FFFFFF";
document.getElementById("tbl_Big").className="tblCorr_";
}
document.getElementById("tbl_head").className="tbl";
document.getElementById("tbl_middle").className="tbl";
document.getElementById("tbl_bottom").className="tbl";
document.getElementById("tbl_foot").className="tbl";
document.getElementById("tbl_main").className="tbl";
document.getElementById("tbl_main2").className="tbl";
}
}
}


function addWork(btn){
if(document.getElementById) { 
tr = btn; 
while (tr.tagName != 'DIV') tr = tr.parentNode;
var tds=tr.getElementsByTagName("TD");
//alert(tds[3].offsetWidth);
var newTr = tr.parentNode.insertBefore(tr.cloneNode(true),tr.nextSibling); 
newTr.innerHTML = '<table width=100% cellspacing=0 cellpadding=0 cellpadding=0 border=0><td valign=top style="padding-top:10px;" width='+tds[0].offsetWidth+'><div style="padding-right:10px;"><input type=text name=yourorg id=yourorg class=inpfaq></div></td><td valign=top style="padding-top:10px;" width='+tds[1].offsetWidth+'><div style="padding-right:10px;"><input type=text name=yourwdate id=yourwdate class=inpfaq></div></td><td valign=top style="padding-top:10px;" width='+tds[2].offsetWidth+'><div style="padding-right:10px;"><input type=text name=yourwdate2 id=yourwdate2 class=inpfaq></div></td><td valign=top style="padding-top:10px;" width='+tds[3].offsetWidth+'><div style="padding-right:10px;"><input type=text name=yourexp id=yourexp class=inpfaq></div></td><td valign=top style="padding-top:10px;" width='+tds[4].offsetWidth+'><div style="padding-right:10px;"><input type=text name=yourexplain id=yourexplain class=inpfaq></div></td><td valign=center name=addWorkB id=addWorkB style="padding-top:7px;" width='+tds[5].offsetWidth+'></td><td valign=center style="padding-top:7px;padding-left:10px;" name=delWorkB id=delWorkB><img src=/img/delete.gif width=16 height=16></td></table>'; 
//newTr.innerHTML = '<table width=100% cellspacing=0 cellpadding=0 cellpadding=0 border=0><td valign=top style="padding-top:10px;padding-right:10px;"><input type=text name=yourorg id=yourorg class=inpfaq></td><td valign=top style="padding-top:10px;padding-right:10px;"><input type=text name=yourwdate id=yourwdate class=inpfaq></td><td valign=top style="padding-top:10px;padding-right:10px;"><input type=text name=yourwdate2 id=yourwdate2 class=inpfaq></td><td valign=top style="padding-top:10px;padding-right:10px;"><input type=text name=yourexp id=yourexp class=inpfaq></td><td valign=top style="padding-top:10px;padding-right:10px;"><input type=text name=yourexplain id=yourexplain class=inpfaq></td><td valign=center name=addWorkB id=addWorkB></td></table>'; 

} 
checkForLastWork(); 
}

function delWork(btn){
if(document.getElementById) { 
tr = btn; 
while (tr.tagName != 'DIV') tr = tr.parentNode; 
tr.parentNode.removeChild(tr); 
} 
checkForLastWork(); 
}

function checkForLastWork(){ 
    btns = document.getElementsByName('addWorkB');
    btnsDel = document.getElementsByName('delWorkB');
//alert(btns.length); 
    for (i = 0; i < (btns.length-1); i++){ 
btns[i].innerHTML='<img src=/img/pix.gif width=16 height=16>'; 
btnsDel[i].innerHTML='<img src=/img/pix.gif width=16 height=16>'; 
}
btns[btns.length-1].innerHTML='<a style="cursor:hand;cursor:pointer;" onclick=addWork(this);><img src=/img/plus.gif></a>';
if ((btnsDel.length-1)>0){btnsDel[btnsDel.length-1].innerHTML='<a style="cursor:hand;cursor:pointer;" onclick=delWork(this);><img src=/img/delete.gif></a>';}
} 

function setAlgo(id){
document.getElementById("algo").value=id;
}



function sendAnketa(){
document.getElementById("anketaResult").innerHTML='<table cellspacing=0 cellpadding=0 border=0><td valign=top><div style="padding-left:6px;padding-right:6px;"><img src=/img/ajax.gif width=30 height=30></div></td><td class=price>отправка анкеты</td></table>';
setTimeout("sendRealAnketa()",500);
}

function sendRealAnketa(){
var numErrors=0;
var errorText='';
if (document.getElementById("yourfio").value==''){errorText+='Не указаны Фамилия, Имя, Отчество.<br>';numErrors=1;}
if (document.getElementById("yourbirth").value==''){errorText+='Не указана Дата рождения.<br>';numErrors=1;}
if (document.getElementById("yourphone").value==''){errorText+='Не указан Контактный телефон.<br>';numErrors=1;}
if (document.getElementById("yourmail").value==''){errorText+='Не указан Электронный адрес (e-mail).<br>';numErrors=1;}
if (document.getElementById("yourcity").value==''){errorText+='Не указан Город.<br>';numErrors=1;}
if (document.getElementById("youradress").value==''){errorText+='Не указан Домашний адрес.<br>';numErrors=1;}
if (document.getElementById("yourstudy").value==''){errorText+='Не указаны Учебные заведения.<br>';numErrors=1;}
if (document.getElementById("yourdiplom").value==''){errorText+='Не указана Специальность по диплому.<br>';numErrors=1;}
if (document.getElementById("yourquality").value==''){errorText+='Не указана Квалификация по диплому.<br>';numErrors=1;}
if (document.getElementById("yourmarks").value==''){errorText+='Не указан Средний балл диплома.<br>';numErrors=1;}

var yourorg=document.getElementsByName("yourorg");
var yourorgX='';
var yourwdate=document.getElementsByName("yourwdate");
var yourwdateX='';
var yourwdate2=document.getElementsByName("yourwdate2");
var yourwdate2X='';
var yourexp=document.getElementsByName("yourexp");
var yourexpX='';
var yourexplain=document.getElementsByName("yourexplain");
var yourexplainX='';
var tempErrors=0;
for (ii=0;ii<yourorg.length;ii++){
if (yourorg[ii].value!='' && yourwdate[ii].value!='' && yourwdate2[ii].value!='' && yourexp[ii].value!='' && yourexplain[ii].value!=''){tempErrors=1;}
yourorgX+=yourorg[ii].value+'^^';
yourwdateX+=yourwdate[ii].value+'^^';
yourwdate2X+=yourwdate2[ii].value+'^^';
yourexpX+=yourexp[ii].value+'^^';
yourexplainX+=yourexplain[ii].value+'^^';
}

if (tempErrors==0){errorText+='Не заполнена информация о Предыдущих местах работы.<br>';numErrors=1;}

if (numErrors>0){
document.getElementById("anketaResult").innerHTML='<div><img src=/img/sendanketa.gif border=0 style="cursor:hand;cursor:pointer;" onclick=sendAnketa();></div><div class=cpr_ style="padding-top:10px;padding-right:13px;">'+errorText+'</div>';
}
else{

var yourfio=document.getElementById("yourfio").value;
var yourbirth=document.getElementById("yourbirth").value;
var yourphone=document.getElementById("yourphone").value;
var yourmail=document.getElementById("yourmail").value;
var yourcity=document.getElementById("yourcity").value;
var youradress=document.getElementById("youradress").value;
var yourduty=document.getElementById("yourduty").value;
var yoursalary=document.getElementById("yoursalary").value;
var yoursrok=document.getElementById("yoursrok").value;
var yourcond=document.getElementById("yourcond").value;
var yourfamily=document.getElementById("yourfamily").value;
var yourchild=document.getElementById("yourchild").value;
var yourstudy=document.getElementById("yourstudy").value;
var yourdiplom=document.getElementById("yourdiplom").value;
var yourquality=document.getElementById("yourquality").value;
var yourmarks=document.getElementById("yourmarks").value;
var yourstud=document.getElementById("yourstud").value;
var yourcomp=document.getElementById("yourcomp").value;
var yourpo=document.getElementById("yourpo").value;
var yourlang=document.getElementById("yourlang").value;
var yourlangQ=document.getElementById("yourlangQ").value;
var yournowork=document.getElementById("yournowork").value;
var yourcv=document.getElementById("yourcv").value;
var yourwho=document.getElementById("yourwho").value;
var yourarmy=document.getElementById("yourarmy").value;
var yourtitle=document.getElementById("yourtitle").value;
var yourcharacter=document.getElementById("yourcharacter").value;
var yoursmoke=document.getElementById("yoursmoke").value;
var yourpeople=document.getElementById("yourpeople").value;
var yourpatient=document.getElementById("yourpatient").value;
var yourattention=document.getElementById("yourattention").value;
var yourboss=document.getElementById("yourboss").value;
var yoursecret=document.getElementById("yoursecret").value;
var yourcareer=document.getElementById("yourcareer").value;
var yourhobby=document.getElementById("yourhobby").value;
var yourtell=document.getElementById("yourtell").value;
var yourflat=document.getElementById("yourflat").value;
var yourcode=document.getElementById("yourcode").value;



var req = getXmlHttp();
req.onreadystatechange = function() {  
if (req.readyState == 4) { 
if(req.status == 200) {
if (req.responseText=='badcode'){document.getElementById("anketaResult").innerHTML='<div><img src=/img/sendanketa.gif border=0 style="cursor:hand;cursor:pointer;" onclick=sendAnketa();></div><div class=cpr_ style="padding-top:10px;padding-right:13px;">Неверно указан код защиты от спама.</div>';}
else {document.getElementById("quesContent").innerHTML='<div style="padding-top:40px;" align=center><table cellspacing=0 cellpadding=0 border=0 width=85%><td valign=top class=pictop_><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=picleft_><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=picbottom_><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=picright_><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=piclt_><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=picrt_><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=picrb_><table cellspacing=0 cellpadding=0 border=0 width=100%><td valign=top class=piclb_ style="padding-top:40px;padding-bottom:40px;padding-left:40px;padding-right:40px;"><table cellspacing=0 cellpadding=0 border=0 width=100%><tr><td valign=top class=mtx>Спасибо! Ваша анкета успешно отправлена.<br><br>Номер Вашей анкеты: '+req.responseText+'.<br><br>Мы обязательно рассмотрим Ваше резюме при наличии вакансии.</td></tr></table></td></table></td></table></td></table></td></table></td></table></td></table></td></table></td></table></div>';}
}
}
}
req.open('GET', '/sendAnketa.php?yourfio='+encodeURI(yourfio)+'&yourbirth='+encodeURI(yourbirth)+'&yourphone='+encodeURI(yourphone)+'&yourmail='+encodeURI(yourmail)+'&yourcity='+encodeURI(yourcity)+'&youradress='+encodeURI(youradress)+'&yourduty='+encodeURI(yourduty)+'&yoursalary='+encodeURI(yoursalary)+'&yoursrok='+encodeURI(yoursrok)+'&yourcond='+encodeURI(yourcond)+'&yourfamily='+encodeURI(yourfamily)+'&yourchild='+encodeURI(yourchild)+'&yourstudy='+encodeURI(yourstudy)+'&yourdiplom='+encodeURI(yourdiplom)+'&yourquality='+encodeURI(yourquality)+'&yourmarks='+encodeURI(yourmarks)+'&yourstud='+encodeURI(yourstud)+'&yourcomp='+encodeURI(yourcomp)+'&yourpo='+encodeURI(yourpo)+'&yourlang='+encodeURI(yourlang)+'&yourlangQ='+encodeURI(yourlangQ)+'&yournowork='+encodeURI(yournowork)+'&yourcv='+encodeURI(yourcv)+'&yourwho='+encodeURI(yourwho)+'&yourarmy='+encodeURI(yourarmy)+'&yourtitle='+encodeURI(yourtitle)+'&yourcharacter='+encodeURI(yourcharacter)+'&yoursmoke='+encodeURI(yoursmoke)+'&yourpeople='+encodeURI(yourpeople)+'&yourpatient='+encodeURI(yourpatient)+'&yourattention='+encodeURI(yourattention)+'&yourboss='+encodeURI(yourboss)+'&yoursecret='+encodeURI(yoursecret)+'&yourcareer='+encodeURI(yourcareer)+'&yourhobby='+encodeURI(yourhobby)+'&yourtell='+encodeURI(yourtell)+'&yourflat='+encodeURI(yourflat)+'&yourorgX='+encodeURI(yourorgX)+'&yourwdateX='+encodeURI(yourwdateX)+'&yourwdate2X='+encodeURI(yourwdate2X)+'&yourexpX='+encodeURI(yourexpX)+'&yourexplainX='+encodeURI(yourexplainX)+'&yourcode='+encodeURI(yourcode), true);  
req.send(null);  // отослать запрос
}
}

