function SolveNoImg() {
  imgs = document.getElementsByTagName('img');
  for (i=0;i<imgs.length;i++) {
    //if(imgs[i]) imgs[i].onerror = function() { this.src = "./webdata/_tpl1/noimg.gif"; }
  }
}
function getObj(name)
{
  if (document.getElementById)
    {this.obj = document.getElementById(name);
    this.style = document.getElementById(name).style;}
  else if (document.all)
    {this.obj = document.all[name];
    this.style = document.all[name].style;}
  else if (document.layers)
    {this.obj = document.layers[name];
    this.style = document.layers[name];}
}

function hidestyle(whichid)
{
  mainobject = new getObj(whichid);
  if (mainobject.style.display=='none')
    {mainobject.style.display='';}
  else
    {mainobject.style.display='none';}
}
function hidestyleON(whichid)
{
  mainobject = new getObj(whichid);
  mainobject.style.display='none';
}

function hidestyleOFF(whichid)
{
  mainobject = new getObj(whichid);
  mainobject.style.display='';
}

function SwitchImg(whichid,src)
{
  mainobject = new getObj(whichid);
  mainobject.obj.src=src;
}

function ObjClass(whichid,clss) {
  mainobject = new getObj(whichid);
  mainobject.obj.className = clss;
}

function WindowOpen(uri,w,h) {
  window.open(uri,'','width='+w+',height='+h+',status=yes,resizable=yes,left='+(screen.width/2-w/2)+',top='+(screen.height/2-h/2)+',scrollbars=no');
}
function jsWindowOpen(uri,w,h) {
  window.open(uri,'','width='+w+',height='+h+',status=yes,resizable=yes,left='+(screen.width/2-w/2)+',top='+(screen.height/2-h/2)+',scrollbars=yes,resizable=yes');
}
function FotoOpen(uri,w,h) {
  window.open(uri,'','width='+(w+20)+',height='+(h+20)+',left='+(screen.width/2-w/2-10)+',top='+(screen.height/2-h/2-10)+',status=yes,resizable=yes,scrollbars=no');
}
function GetName(p) {
  var pole = p.split('\\');
  var file = pole[pole.length-1];
  var pole = file.split('.');
  if(pole.length>=2) return pole[pole.length-2];
  if(pole.length>=1) return pole[pole.length-1];
}
function HotelsHideAll(j) {
  for(i=1;i<j;i++) {
    hidestyleOFF('hotels_hotel_'+i+'a');
    hidestyleON('hotels_hotel_'+i+'b');
  }
}
var lastpulldown = '';
function OpenPullDown(whichid) {
  hidestyleOFF(whichid);
  if(lastpulldown!='' && whichid!=lastpulldown) hidestyleON(lastpulldown);
  lastpulldown = whichid;
}
function ClosePullDown() {
  if(lastpulldown!='') hidestyleON(lastpulldown);
}
function KeepPullDown() {
  if(lastpulldown!='') hidestyleOFF(lastpulldown);
}
function CheckEmail(str) {
  var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  return filter.test(str);
}
function WriteMarquee(str) {
  return '<marquee scrolldelay="10" scrollamount="2">'+str+'</marquee>';
}
function CheckValidDate(month, day, year)
{
  var monthLength = new Array(31,28,31,30,31,30,31,31,30,31,30,31);

  if (!day || !month || !year) return false;

  // check for bisestile year
  if (year/4 == parseInt(year/4)) monthLength[1] = 29;

  if (month < 1 || month > 12) return false;

  if (day > monthLength[month-1]) return false;

  return true;
}

function FindMenuItemsToEmph() {
  cntr = 0;
  tmp1 = document.getElementsByTagName('li');
  for(i=0;i<tmp1.length;i++) {
    if(tmp1[i].className=='menutoemph') {
      tmp2 = tmp1[i].getElementsByTagName('a');
      for(j=0;j<tmp2.length;j++) {
        itemstoemph[cntr] = tmp2[j].id;
        cntr++;
      }
    }
  }
}
function EmphMenuItemsLoop(lp) {
  for(i=0;i<itemstoemph.length;i++) {
    ObjClass(itemstoemph[i],lp==1?'actwebmenu':'');
  }
  if(lp==1) lp=0; else lp=1;
  setTimeout('EmphMenuItemsLoop('+lp+')',500);
}
function SysRoundPrice(str) {
  return str;
}
function DomValGet(whichid) {
  mainobject = new getObj(whichid);
  return mainobject.obj.value;
}
function DomValSet(whichid,val) {
  mainobject = new getObj(whichid);
  mainobject.obj.value = val;
}
function DomWriteIn(whichid,str) {
  mainobject = new getObj(whichid);
  mainobject.obj.innerHTML = str;
}

function GetInt(str) {
  if(str!=str*1) {
    return parseInt(str);
  } else {
    return str;
  }
}