function restore()
{ 
  var i,x,a=document.sa; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
     x.src=x.oSrc;
}

function find(n, d) 
{ 
  var p,i,x;  
  if(!d) 
   d=document; 
  if((p=n.indexOf("?"))>0&&parent.frames.length) 
  {
    d=parent.frames[n.substring(p+1)].document; 
    n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) 
    x=d.all[n]; 
  for (i=0;!x&&i<d.forms.length;i++) 
    x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
    x=find(n,d.layers[i].document);
  if(!x && d.getElementById) 
    x=d.getElementById(n); 
  return x;
}

function swap() 
{ 
  var i,j=0,x,a=swap.arguments; 
  document.sa=new Array; 
  for(i=0;i<(a.length-2);i+=3)
   if ((x=find(a[i]))!=null)
   {
     document.sa[j++]=x; 
     if(!x.oSrc) 
       x.oSrc=x.src; 
     x.src=a[i+2];
   }
}

var win = null;
function popWin(mypage,myname,w,h,scroll){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=yes';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

// usage:
// onclick="popWin('url','name','400','400','yes');return false"


function left()
{
document.write('<br>');
document.write('<img src="images/buttonheader.png" border="0"><br>');
document.write('<a href="stones.html" onMouseOut="restore()" onMouseOver="swap( &#39;button_1&#39;, &#39; &#39;, &#39;images/button_stones_on.png&#39;,1)">');
document.write('        <img name="button_1" src="images/button_stones.png" width="150" height="30" border="0" title="Semi-precious stones"></a><br>');
document.write('<a href="silver.html" onMouseOut="restore()" onMouseOver="swap( &#39;button_2&#39;, &#39; &#39;, &#39;images/button_silver_on.png&#39;,1)">');
document.write('        <img name="button_2" src="images/button_silver.png" width="150" height="30" border="0" title="Sterling silver"></a><br>');
document.write('<a href="gold.html" onMouseOut="restore()" onMouseOver="swap( &#39;button_3&#39;, &#39; &#39;, &#39;images/button_gold_on.png&#39;,1)">');
document.write('        <img name="button_3" src="images/button_gold.png" width="150" height="30" border="0" title="14K Gold"></a><br>');
document.write('<a href="crystal.html" onMouseOut="restore()" onMouseOver="swap( &#39;button_4&#39;, &#39; &#39;, &#39;images/button_crystal_on.png&#39;,1)">');
document.write('        <img name="button_4" src="images/button_crystal.png" width="150" height="30" border="0" title="Swavorski Crystal"></a><br>');
document.write('<a href="fashion.html" onMouseOut="restore()" onMouseOver="swap( &#39;button_5&#39;, &#39; &#39;, &#39;images/button_fashion_on.png&#39;,1)">');
document.write('        <img name="button_5" src="images/button_fashion.png" width="150" height="30" border="0" title="Fashion jewelry"></a><br>');
document.write('<a href="signs.html" onMouseOut="restore()" onMouseOver="swap( &#39;button_6&#39;, &#39; &#39;, &#39;images/button_signs_on.png&#39;,1)">');
document.write('        <img name="button_6" src="images/button_signs.png" width="150" height="30" border="0" title="Sign language jewelry"></a><br>');
document.write('<a href="novelty.html" onMouseOut="restore()" onMouseOver="swap( &#39;button_7&#39;, &#39; &#39;, &#39;images/button_novelty_on.png&#39;,1)">');
document.write('        <img name="button_7" src="images/button_novelty.png" width="150" height="30" border="0" title="Novelty items"></a><br>');
document.write('<a href="sales.html" onMouseOut="restore()" onMouseOver="swap( &#39;button_8&#39;, &#39; &#39;, &#39;images/button_sales_on.png&#39;,1)">');
document.write('        <img name="button_8" src="images/button_sales.png" width="150" height="30" border="0" title="Sale items"></a><br>');
document.write('<img src="images/buttonbottom.png" border="0"><br>');
document.write('<p><br><br><br></p>');
document.write('<p><br><br><br></p>');
document.write('<p><br><br><br></p>');
document.write('<p><br><br><br></p>');
document.write('<p><br><br><br></p>');
document.write('<p><br><br><br></p>');
}
