var xtime;
var current = 0;
var confirmMsg  = ' ';
var clicked = true;
var nn4 = document.layers;

var bookmarkurl="http://www.worldtravelserver.com"
var bookmarktitle="WorldtTavelServer.com"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function webstatistika_help(content)
{
        document.write(content);
}

function openWinScroll(https,wid,hei,name){
shopWin = open(https, name, "scrollbars=yes,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();
}

function phpads_deliverActiveX(content)
{
        document.write(content);
}

function phpads_deliverActiveX2(_id, content) {
    if (document.getElementById(_id)) {
        document.getElementById(_id).innerHTML = content;
    }
}

function confirmLink(theLink, theSqlQuery)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' \n' + theSqlQuery);

    return is_confirmed;
}

function confirmdel()
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm('Attantion! \n DELETE THIS ROW?');

    return is_confirmed;
}

function checkMail(x)
{
        var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        if (filter.test(x)) return 1;
        else return 0;
}

function checkFormClientSend() {

       document.getElementById('oname').style.display="none";
       document.getElementById('oemail').style.display="none";
       document.getElementById('ocomment').style.display="none";

       if (document.clientFormConnect.name.value=='') {
           document.getElementById('oname').style.display="";
           document.clientFormConnect.name.focus();
           return false;

       }
       if (document.clientFormConnect.email.value=='') {
           document.getElementById('oemail').style.display="";
           document.clientFormConnect.email.focus();
           return false;

       }
       if (document.clientFormConnect.email.value != '') {
           _ret = checkMail(document.clientFormConnect.email.value);
           if (!_ret) {
              document.getElementById('oemail').style.display="";
              document.clientFormConnect.email.focus();
              return false;
           }

       }
       if (document.clientFormConnect.comment.value=='') {
           document.getElementById('ocomment').style.display="";
           document.clientFormConnect.comment.focus();
           return false;

       }

       if (document.clientFormConnect.secimg.value=='') {
           document.getElementById('osecimg').style.display="";
           document.clientFormConnect.secimg.focus();
           return false;

       }

       return true;

}

function OnClickFunctions() {
    // alert('xx');

     if (clicked == true) {
         if (document.getElementById('selectBoxContentgolocal').style.visibility == 'visible') {
             document.getElementById('selectBoxContentgolocal').style.visibility = 'hidden';
             //alert('1');
         }
         if (document.getElementById('selectBoxContentgotravel').style.visibility == 'visible') {
             document.getElementById('selectBoxContentgotravel').style.visibility = 'hidden';
             //alert('2');
         }
     }

     document.getElementById('alertx').style.visibility = "hidden";
     clicked == true;



}

function checkmail() {


    if (document.FormName.T7.value != '') {
         document.getElementById('CH1').disabled = false;
         document.getElementById('CH1').checked = true;

    } else {

         document.getElementById('CH1').checked = false;
         document.getElementById('CH1').disabled = true;
    }

}

function OnClickFunctions2() {
    // alert('xx');
     if (clicked == true) {
         if (document.getElementById('selectBoxContentgolocal').style.visibility == 'visible') {
             document.getElementById('selectBoxContentgolocal').style.visibility = 'hidden';
             //alert('1');
         }
     }
     clicked == true;



}

function OnLoadFunctions() {
    timeDiff();
   // runFlash();


}

function checkform() {
 if ( document.getElementById('firstname').value!="" &&
     document.getElementById('lastname').value!="" &&
     document.getElementById('address1').value!="" &&
     document.getElementById('city').value!="" &&
     document.getElementById('state').value!="" &&
     document.getElementById('zip').value!="" &&
     document.getElementById('email').value!="" &&
     document.getElementById('phone1').value!="" &&
     document.getElementById('phone2').value!="" &&
     document.getElementById('phone3').value!="" &&
     document.getElementById('quantity').value>0 )
       { return true;   }
     else {
        alert('Required field not completed');
        return false;
             }



}

function showmenu(x, y) {

    xget = document.getElementById(x);
    xx = findposx(y);
    yy = findposy(y);
    xget.style.left = xx+2;
    xget.style.top = yy + 18;
    xget.style.visibility="visible";
    if (xtime) {
        clearTimeout(xtime);
    }


}

function hidemenu(x) {




xtime = setTimeout('hide_m("'+x+'")',500);
}


function hide_m(x) {

    xget = document.getElementById(x);

    xget.style.visibility="hidden";

        }

function findposx(x) {

    xget1 = document.getElementById("posi1");
    xget2 = document.getElementById("posi2");
    xget3 = document.getElementById(x);
    xgetx = xget1.offsetLeft+xget2.offsetLeft+xget3.offsetLeft;
    xgety = xget1.offsetTop+xget2.offsetTop+xget3.offsetTop;
    //alert('x: '+xgetx+' y: '+xgety);
    return xgetx+15;
}

function findposy(x) {

    xget1 = document.getElementById("posi1");
    xget2 = document.getElementById("posi2");
    xget3 = document.getElementById(x);
    xgetx = xget1.offsetLeft+xget2.offsetLeft+xget3.offsetLeft;
    xgety = xget1.offsetTop+xget2.offsetTop+xget3.offsetTop;
    //alert('x: '+xgetx+' y: '+xgety);

    return xgety;
}

function getElementHeight(Elem) {

                if(document.getElementById) {
                        var elem = document.getElementById(Elem);
                } else if (document.all){
                        var elem = document.all[Elem];
                }
               /* if (op5) {
                        xPos = elem.style.pixelHeight;
                } else {
                        xPos = elem.offsetHeight;
                }       */
                xPos = elem.offsetHeight;
                //alert(xPos)
                if (xPos > 205) {
                document.getElementById('ihtml1').style.visibility = 'visible';
                document.getElementById('ihtml2').style.visibility = 'visible';
                }
                //return xPos;


}

function nnfocus() {
   // alert('xxx');
    if (nicknames == document.callform.T2.value) {
        document.callform.T2.value = '';
    }

}

function nnblur() {
    if (document.callform.T2.value == '') {
        document.callform.T2.value = nicknames;
    }

}

function getElementWidth(Elem) {
        if (ns4) {
                var elem = getObjNN4(document, Elem);
                return elem.clip.width;
        } else {
                if(document.getElementById) {
                        var elem = document.getElementById(Elem);
                } else if (document.all){
                        var elem = document.all[Elem];
                }
                if (op5) {
                        xPos = elem.style.pixelWidth;
                } else {
                        xPos = elem.offsetWidth;
                }
                return xPos;
        }
}


function reload_city(x, y) {

    if (y == 'add_city_popup') {

        openw3('addcity/index.php', 780, 504);

    } else {
        location.href='?country='+ x +'&city='+ y +'&cat_id=1';
    }

}


function checkMail(x)
{
        var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        if (filter.test(x)) return 1;
        else return 0;
}


function openwXX(https,wid,hei,name){
shopWin = open(https, name, "scrollbars=no,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }

function openw(https,wid,hei){
shopWin = open(https, "Foto", "scrollbars=no,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }

function openw2(https,wid,hei){
shopWin = open(https, "Foto2", "scrollbars=yes,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }

function openw4(https,wid,hei){
shopWin = open(https, "Foto4", "scrollbars=yes,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }
function openw5(https,wid,hei){
shopWin = open(https, "Foto5", "scrollbars=yes,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }
function openw6(https,wid,hei){
shopWin = open(https, "Foto6", "scrollbars=yes,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }
function openw7(https,wid,hei){
shopWin = open(https, "Foto6", "scrollbars=no,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }
function openw8(https,wid,hei){
shopWin = open(https, "Foto6", "scrollbars=no,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }
function openw3(https,wid,hei){
shopWin = open(https, "Foto3", "scrollbars=no,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }
function openw9(https,wid,hei){
shopWin = open(https, "Foto9", "scrollbars=yes,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }

function openw10(https,wid,hei){
shopWin = open(https, "Foto9", "scrollbars=yes,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();

        }
function confirmLink(theLink, theSqlQuery)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' \n' + theSqlQuery);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
}


function movein2(which, which2, html){
if (html == menu) return 1;
document.getElementById(which).style.background='#3B507D';
document.getElementById(which2).style.background='#EDEDEF';
}
function moveout2(which, which2,  html){
if (html == menu) return 1;
document.getElementById(which).style.background='#DFE0E2';
document.getElementById(which2).style.background='#FFFFFF';
}


function movein(which){
document.getElementById(which).style.backgroundColor = "#FEC611";
}

function moveout(which){
document.getElementById(which).style.backgroundColor = "";
}


function change_im(id, image){
document.getElementById(id).src=image;
}

function changefont(id, image){

 //alert(image);
document.getElementById(id).src = image;
}

function changefontb(id, image) {


  //alert(id);

//document.getElementById(id).src = image;
//xtime2 = setTimeout("changefontbb('"+id+"','"+image+"')",0);

}


function changefontbb(id, image) {

//alert('aa');
document.getElementById(id).src = image;

 }


 function checkform() {
 if (document.getElementById('T1').value!="" &&
     document.getElementById('T2').value!="" &&
     document.getElementById('T3').value!="" &&
     document.getElementById('S1').value!="")
       { return true;   }
     else {
        alert('Visi laukumi obligāti');
        return false;
             }



}

function chbg(id1, id2, id3, id4, id5) {

     document.getElementById(id1).style.backgroundColor = '#899A8A';
     document.getElementById(id2).style.backgroundColor = '#899A8A';
     document.getElementById(id3).style.backgroundColor = '#899A8A';
     document.getElementById(id4).style.backgroundColor = '#899A8A';
     document.getElementById(id5).style.backgroundColor = '#899A8A';
     //alert('ccc');

}

function chbgback(id1, id2, id3, id4, id5) {

     document.getElementById(id1).style.backgroundColor = '#FFFFFF';
     document.getElementById(id2).style.backgroundColor = '#D8E0D3';
     document.getElementById(id3).style.backgroundColor = '#D8E0D3';
     document.getElementById(id4).style.backgroundColor = '#D8E0D3';
     document.getElementById(id5).style.backgroundColor = '#D8E0D3';
     //alert('ccc');

}

function setfade(a, b) {
   i = 0;
   while(document.getElementById('fid'+i)) {
       var x = document.getElementById('fid'+i);
       x.filters.alpha.opacity=100;
       //alert(x);
       i++;
   }

   if (document.getElementById(a)) {

       var x = document.getElementById(a);
       x.filters.alpha.opacity=b;

   }

}
staticobj = new Object();statitimer = new Object();function reloadz() { window.location.reload();
//self.close();
//return false;
        } var nn6 = document.documentElement;if(document.all) {nn6 = false;}
var ie4 = (document.all && !document.getElementById);
var ie5  = (document.all && document.getElementById);var a;


function stat(a, b, c, d){ if (!document.all) return
if (a != "[object]"){   setTimeout("stat("+a+","+b+","+c+","+d+")",0);         return;      }      clearTimeout(statitimer[a.sourceIndex]);      settimme = b-a.filters.alpha.opacity;   setstep = 1;   if (a.filters.alpha.opacity > b){   setstep = -1;
    }    d=Math.min(setstep*settimme,d); a.filters.alpha.opacity+=setstep*d; if (a.filters.alpha.opacity != b){  staticobj[a.sourceIndex]=a;  statitimer[a.sourceIndex]=setTimeout("stat(staticobj["+a.sourceIndex+"],"+b+","+c+","+d+")",c);   }

    }




    function sset(thelayer,pl,pt) {  var unit = "";  thelayer = document.all ? document.all[thelayer] : document.getElementById ? document.getElementById(thelayer) : NSStyle(thelayer);  thelayer = document.layers ? thelayer : thelayer.style;   if(document.getElementById) {unit = "px";}   thelayer.left = pl + unit;  thelayer.top  = pt + unit;  return; }  function get(thelayer) {  lpz = new Array();  thelayer = document.all ? document.all[thelayer] : document.getElementById ? document.getElementById(thelayer) : NSStyle(thelayer);  lpz[0] = document.layers ? thelayer.top : thelayer.offsetTop;   lpz[1] = document.layers ? thelayer.left : thelayer.offsetLeft; lpz[2] = document.layers ? thelayer.document.width : thelayer.offsetWidth;  lpz[3] = document.layers ? thelayer.document.height : thelayer.offsetHeight;  return(lpz);} function initScroller() { for (var i=0; i<initScroller.arguments.length; ++i) {  ln = initScroller.arguments[i] + "0";  ld = new Array();  ld = get(ln);  chn  = initScroller.arguments[i] + "1";  ch  = new Array();  ch  = get(chn);  if(nn4) {    clipHeight = document.layers[ln].clip.height;   }  else {    clipHeight = ld[3];    }  if(ch[3] > clipHeight) {    vSwitch(initScroller.arguments[i]+"ScrollControl",1);  }  } }
function breaks() { a = false; }
function startScroll(am, namez) {
this.am = am;
this.namez  = namez;
 a = true;
 ln = namez+"0";
 chn  = namez+"1" ;
 doScroll(am);

}
function doScroll(am) {
this.am = am;
ld = new Array();
ld = get(ln);
ch  = new Array();
ch  = get(chn);
if(am>0) {
   if(nn4) {    clipHeight = document.layers[ln].clip.height;   }   else {      clipHeight = ld[3];
    }  if(ch[0] > -(ch[3] - clipHeight)) {  sset(chn,0,(ch[0]-am));  }   }  else { if(ch[0] < 0) {  sset(chn,0,(ch[0]-am));  } }  if(a) {  setTimeout("doScroll(am)",1);  } }

function setfade2(a, b) {
   i = 0;
   while(document.getElementById('fid'+i)) {
       var x = document.getElementById('fid'+i);
       x.filters.alpha.opacity=100;
       //alert(x);
       i++;
   }

   if (document.getElementById(a)) {

       var x = document.getElementById(a);
       x.filters.alpha.opacity=b;

   }

}

function setactive2(a, b) {

   i = 0;
   while(document.getElementById('bid'+i)) {
       var x = document.getElementById('bid'+i);
       x.style.fontWeight="normal";
       i++;
   }

   if (document.getElementById(a)) {

       var x = document.getElementById(a);
       x.style.fontWeight="bold";

   }
   current = b;
}


function checkSearch() {
   // return false;
    if (document.SearchFormName.searchstr.value.length < 3) {
         setTimeout("setVisibleAlert()", 1);
         setTimeout("setHiddenAlert()", 3000);
         return false;
    } else {
         return true;
    }

   // return false;

}

function checkSearch2() {
  // alert('aaa');
    if (document.FormCatSearch.catsearch.value.length < 3) {
         setTimeout("setVisibleAlert2()", 1);
         setTimeout("setHiddenAlert2()", 3000);
         return false;
    } else {
         return true;
    }

   // return false;

}


function checkSearch2x(_idx) {
  // alert('aaa');
    if (document.FormCatSearch.T1.value.length < 3) {
         document.FormCatSearch.T1.focus();
         setTimeout("setVisibleAlertAdv('"+_idx+"')", 1);
         setTimeout("setHiddenAlertAdv('"+_idx+"')", 3000);
         return false;
    } else {
         return true;
    }

   // return false;

}


function checkSearch2Adv(_idx) {

    if (document.FormCatSearchAdv.T1.value.length < 3
    && document.FormCatSearchAdv.D1.value == 0
    && document.FormCatSearchAdv.D2.value == 0
    && document.FormCatSearchAdv.D3.value == 0) {
         document.FormCatSearchAdv.T1.focus();
         setTimeout("setVisibleAlertAdv('"+_idx+"')", 1);
         setTimeout("setHiddenAlertAdv('"+_idx+"')", 3000);
         return false;
    } else {
         return true;
    }

    return false;

}

function setHiddenAlert() {


    document.getElementById('alertx').style.visibility = "hidden";

}

function setVisibleAlert() {


    document.getElementById('alertx').style.visibility = "visible";

}


function setHiddenAlertAdv(_idx) {


    document.getElementById(_idx).style.visibility = "hidden";

}

function setVisibleAlertAdv(_idx) {


    document.getElementById(_idx).style.visibility = "visible";

}

function setHiddenAlert2() {


    document.getElementById('alertx2').style.visibility = "hidden";

}

function setVisibleAlert2() {


    document.getElementById('alertx2').style.visibility = "visible";

}






function setHiddenAlertX(_id) {


    document.getElementById(_id).style.visibility = "hidden";

}

function setVisibleAlertX(_id) {


    document.getElementById(_id).style.visibility = "visible";

}




     /*   function runFlash()
                {
                if ((navigator.appName.indexOf("Netscape")== -1)) {
                        //var stringText = top.frames[4].infoText
                        setTimeout("runFlash()",5000)
                }
                }    */
                var        loggedInUsers = ""