ptr=0;
imgs=new Array();

function popup(url, canresize) {
  x = Math.random() * 50;
  y = Math.random() * 50;
  window.open(url, "", "top = " + y + ", left = " + x + ", height = 370, width = 370, menubar = no, resizable = " + canresize + ", status = no");
}


function xxpopupdynamic(url, resizable, height, width, menu, canscroll) {
  x = Math.random() * 50;
  y = Math.random() * 50;
  window.open(url, "", "top = " + y + ", left = " + x + ", height = " + height + ", width = " + width + ", menubar = no, resizable = " + resizable + ", toolbar = " + menu + ", location = " + menu + ", status = no, scrollbars = " + canscroll);
}

function popupmovie(movie, height, width) {
  x = Math.random() * 50;
  y = Math.random() * 50;
  vidscreen=window.open('movie.php', "", "top = " + y + ", left = " + x + ", height = " + height + ", width = " + width + ", menubar = no, resizable = yes, status = no");
  vidscreen.document.cookie=movie;
}

function xxnavigate(url) {
  if (navigator.appName.indexOf("Microsoft")!=-1)
    {
      window.navigate(url);
    }
    else {
      window.location = url;
    }
}

function cascademenu(xctrl) { 
  if (xctrl.style.display == "") { 
    xctrl.style.display = "none"; 
  } 
  else {
    xctrl.style.display = ""; 
  } 
}

marqueecnt=-1;
marqueearr=new Array("SiTa Moxon Jewellery", "Platinum, Silver, and Gemstones", "Thailand");

function marquee(xctrl) {
  tctrl=xctrl;
  xxctrl=document.getElementById(tctrl);
  if(marqueecnt==-1) {
    marqueecnt=0;
  }
  else {
    xxctrl.innerHTML=marqueearr[marqueecnt];
  }
  marqueecnt++;
  if (marqueecnt==3) { marqueecnt=0; }
  setTimeout ("marquee(tctrl)", 3000);
}

function loadphoto(xfiles, xdir, xval, xname) {
  imgs = xfiles.split(",");
  cnt = imgs.length;
  if(xval < -1) { ptr = 0; }
  if(xval == -1) { ptr--; }
  if(xval > 1) { ptr = cnt-1; }
  if(xval == 1) { ptr++; }
  if(ptr >= cnt) { ptr = cnt-1; }
  if(ptr < 0) { ptr = 0; }
  xpath = xdir + "/" + imgs[ptr];
  xctrl = document.getElementById("slideshowphoto");
  xctrl.src = xpath;
  xctrl = document.getElementById(xname);
  if (xctrl) {
    xctrl.innerHTML = "&#160;&#160;Photo " + (ptr+1) + " of " + cnt;
  }
  xctrl = document.getElementById('xurl');
  if (xctrl) {
    xctrl.href=xpath;
  }
}
