
// travel.js by Oto Valek <oto@valek.net>
// thanks for viewing the source code !

// system.js needed

 function photopopup(small_path,w,h,desc,alt,link,big_path,panorama_width) {
   if (panorama_width) {
    var scrollbars = 'scrollbars=1,'
    if (panorama_width > 1024) {
     var winh = h + 16
     var winw = 1024
    }
    else {
     var winh = h
     var winw = panorama_width
    }
   }
   else {
    var scrollbars = 'scrollbars=0,'
    var winh = h
    var winw = w
   }
   if (navigator.userAgent.indexOf("Opera") != -1) {
    winh += 2;
    winw += 2;
   }
   var win = window.open('','on',scrollbars+'titlebar=0,status=0,statusbar=0,toolbar=0,directories=0,location=0,menu=0,menubar=0,resizable=0,directories=0,screenX=50,screenY=20,width='+winw+',height='+winh)
   if (!win) return;
   var onclick_command = "self.close();"
   var a_href = "javascript:void(null)"
   if (big_path && (big_path != '0')) {
    if (big_path.indexOf('.avi') != -1 || big_path.indexOf('.mp3') != -1) {
//     onclick_command  = "top.location.href = '"+big_path+"';"
     onclick_command = ""
     a_href = big_path
    }
    else {
     onclick_command  = "window.open('"+big_path+"','on','titlebar=0,status=0,scrollbars=1,toolbar=0,location=0,menu=0,resizable=1,directories=0');"+onclick_command
    }
   }
   with (win.document) {
    write('<HTML STYLE="padding:0; margin:0;"><HEAD><TITLE>'+desc+'</TITLE></HEAD>')
    write('<BODY BGCOLOR="#000000" TOPMARGIN=0 LEFTMARGIN=0 RIGHTMARGIN=0 BOTTOMMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 STYLE="font-size:0; margin:0; padding:0;">')
    if (panorama_width) {
     w = panorama_width
    }
    write('<A STYLE="padding:0; margin:0;" ONCLICK="'+onclick_command+'" HREF="'+a_href+'"><IMG STYLE="padding:0; margin:0;" ALT="'+alt+'" TITLE="'+alt+'" BORDER=0 SRC="'+small_path+'" WIDTH='+w+' HEIGHT='+h+'></A></BODY></HTML>')
    close()
   }
   win.name = "off"
   link.href = "javascript:void(null)"
   link.target = "_self"
 }

 function simplepopup(path,w,h,desc,link) {
  var win = window.open('','on','titlebar=0,status=0,toolbar=0,directories=0,location=0,menu=0,menubar=0,resizable=0,directories=0,screenX=50,screenY=20,width='+w+',height='+h)
  if (!win) return;
  with (win.document) {
   write('<HEAD><TITLE>'+desc+'</TITLE></HEAD>')
   write('<BODY BGCOLOR="#000000" TOPMARGIN=0 LEFTMARGIN=0 RIGHTMARGIN=0 BOTTOMMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 STYLE="padding-left:0; padding-top:0; padding-right:0; padding-bottom:0; left:0; top:0; right:0; bottom:0; position:absolute; margin:0; padding:0;">')
   write('<A HREF="javascript:self.close()"><IMG BORDER=0 SRC="'+path+'" WIDTH='+w+' HEIGHT='+h+'></A></BODY>')
  }
  win.name = "off"
  link.href = "javascript:void(null)"
  link.target = "_self"
 }

 function select_recount(sel,cnt) {
  c = 0
  for (i=0;i<sel.length;i++) {
   if (sel.options[i].selected=="1") { c++ }
  }
  cnt.value = c
 }
