// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = false;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}

var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle,pCompanyLogo){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>'+imageTitle+'</title>');
writeln('<link href="lib/jewelscart2000.css" rel=stylesheet type=text/css>');
writeln('<style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('function resizeImage(){var w,h;');
writeln('w=document.images[2].width;h=document.images[2].height;document.images[2].width = w;document.images[2].height = h;}');
writeln('var isNN,isIE;');
writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');
writeln('if (isIE){');
writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[2].width);');
writeln('height=100-(document.body.clientHeight-document.images[2].height);');
writeln('window.resizeTo(width+document.images[0].height+30,height+document.images[0].height+30);document.images[1].width=document.images[2].width;document.images[1].height=document.images[2].height;}');
writeln('if (isNN){');       
writeln('window.innerWidth=document.images[2].width;');writeln('window.innerHeight=document.images[2].height+document.images[0].height+40;');
writeln('document.images[1].width=document.images[2].width;document.images[1].height=document.images[2].height;}}');
writeln('function doTitle(){}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor="#080A61" scroll="no" onload="resizeImage();reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor="#080A61" scroll="no" onload="resizeImage();reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0" bgcolor="#080A61">');
writeln('<TR><TD align="left"><img id="pCompanyLogo" name="pCompanyLogo" src="'+pCompanyLogo+'" border=0></TD></TR>');
writeln('<tr><td>&nbsp;</td></tr>');
writeln('<TR><TD align="left"><a href="javascript:window.close()"><img style="position: absolute; z-index: 1;" src="catalog/cleardot.gif" border=0 id=clear name=clear align=left><img id="zoomPic" name="zoomPic" src="'+imageURL+'" border=0 class="imageBorder"></a></TD></TR>');
writeln('<TR><TD align="left"><a href="javascript:window.close()">Close</a></TD></TR></TABLE></body></html>');
close();		
}}

// -------------------simple pop up
var newwindow = ''
function popitup(url) {
if (newwindow.location && !newwindow.closed) {
    newwindow.location.href = url; 
    newwindow.focus(); } 
else { 
    newwindow=window.open(url,'htmlname','width=400,height=300,resizable=1');} 
}


function tidy() {
if (newwindow.location && !newwindow.closed) { 
   newwindow.close(); } 
}

// -------------------- another simple pop up
function popImage2(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>'+imageTitle+'</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('function resizeImage(){var w,h;');
writeln('w=document.images[1].width;h=document.images[1].height;document.images[1].width = w;document.images[1].height = h;}');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[1].width);');
writeln('height=100-(document.body.clientHeight-document.images[1].height);');
writeln('window.resizeTo(width,height+30);document.images[0].width=document.images[1].width;document.images[0].height=document.images[1].height;}');
writeln('if (isNN){');       
writeln('window.innerWidth=document.images[1].width;');writeln('window.innerHeight=document.images[1].height+50;');
writeln('document.images[0].width=document.images[1].width;document.images[0].height=document.images[1].height;}}');
writeln('function doTitle(){}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor="white" scroll="no" onload="resizeImage();reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor="white" scroll="no" onload="resizeImage();reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0">');
writeln('<TR><TD align="left"><img style="position: absolute; z-index:2;" width=20 height=20 src="catalog/cleardot.gif" border=0 id=clear name=clear align=left><img id="zoomPic" name="zoomPic" src="'+imageURL+'" border=0></TD></TR>');
writeln('<TR><TD align="left"><a href="javascript:window.close()">Close</a></TD></TR></TABLE></body></html>');
close();		
}}

//----------------Video upload
var opts='scrollbars=no,width=300,height=300,left=100,top=100';
function popVideo(videoURL,videoTitle){
imgWin=window.open('about:blank','',opts);
with (imgWin.document){
writeln('<html><head><title>'+videoTitle+'</title>');
writeln('<sc'+'ript>');
writeln('var isNN,isIE;');
writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');
writeln('if (isIE){');
writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.all["VIDEO"].width);');
writeln('height=100-(document.body.clientHeight-document.all["VIDEO"].height-document.images[0].height);');
writeln('window.resizeTo(width,height);}');
writeln('if (isNN){');       
writeln('window.innerWidth=document.all["VIDEO"].width;');
writeln('window.innerHeight=document.all["VIDEO"].height+document.images[0].height;');
writeln('}}');
writeln('function doTitle(){}');
writeln('</sc'+'ript>');
writeln('</head>');
writeln('<body bottommargin=0 leftmargin=0 rightmargin=0 topmargin=0 bgcolor="white" scroll="no" onload="reSizeToImage();self.focus()">');
writeln('<table border=0 cellpadding=0 cellspacing=0><tr align=right valign=top><td align=right valign=top>');
writeln('<a href="javascript:window.close()"><img border=0 src="images/close_button.gif" align=right></a>');
writeln('</td></tr><tr align=left valign=top><td align=left valign=top>');
writeln('<embed id="VIDEO" src="'+videoURL+'" pluginspage="http://www.microsoft.com/windows/windowsmedia/" loop="true" controller="true" autoplay="true" alt="Loading..."></embed>');
writeln('</td></tr></table>');
writeln('</body></html>');
close();}}
