var popUpHTM=0;

function popUpHTML(URLStr)

{

  if(popUpHTM)

  {

    if(!popUpHTM.closed) popUpHTM.close();

  }

  popUpHTM = open(URLStr, 'popUpHTM', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+670+',height='+300+',left='+200+', top='+150+'');

}

PositionX = 0;

PositionY = 0;

defaultWidth  = 540;

defaultHeight = 320;

var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){

var isNN=( navigator.appName=="Netscape")?1:0;

var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}

else close(); 

var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY; 

var optIE='scrollbars=no,width=160,height=100,left='+PositionX+',top='+PositionY;



function popImage(imageURL){

if (isNN){imgWin=window.open('about:blank','',optNN);}

if (isIE){imgWin=window.open('1-888-666-1639','',optIE);} 

with (imgWin.document){

writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');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=document.images[0].width + 25;//100-(document.body.clientWidth-document.images[0].width-25);');

//writeln('alert(document.images[0].src);');

//writeln('height=100-(document.body.clientHeight-document.images[0].height-60);');

writeln('height=document.images[0].height+160;');

//writeln('alert(width)');

writeln('window.resizeTo (width,height);}');writeln('if (isNN){');       

writeln('window.innerWidth=25+document.images["rn"].width;');writeln('window.innerHeight=85+document.images["rn"].height;}}');

writeln('function doTitle(){ document.title="Luxaris Home and Spa Store";}');writeln('</sc'+'ript>');

if (!AutoClose) writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()">') 

<!-- Hide from old browsers

else writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()">');

writeln('<table border = 0 width = 100% height = 100%><tr><td align = center valign = center><img name="rn" src='+imageURL+' style="display:block"><br><a href = "javascript: window.close();"><img border = "0" src = "http://www.luxaris.com/luxstores/butt-close.jpg"></a> &nbsp; &nbsp; <a href = "javascript: window.print();"><img border = "0" src = "http://www.luxaris.com/luxstores/butt-print.jpg"></a></td></tr><tr><td align=center><font color=#666666 size=-1>Image displayed may differ from actual product appearance, especially in finish.</font></td></tr></table></body></html>' ); 

close(); 

};}

function TellFriend(prio){

PositionX = 0;

PositionY = 0;

defaultWidth  = 600;

defaultHeight = 500;

var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){

var isNN=( navigator.appName=="Netscape")?1:0;

var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}

else close(); 

var optNN='status=yes,scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY; 

var optIE='status=yes,scrollbars=yes,width=600,height=500,left='+PositionX+',top='+PositionY;



var pageref = location.href

if (isNN){imgWin=window.open('about:blank','',optNN);}

if (isIE){imgWin=window.open('1-888-666-1639','',optIE);} 

with (imgWin.document){

writeln('<html><head><title>Loading...</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 doTitle(){ document.title="Luxaris Home and Spa Store";}');writeln('</sc'+'ript>');

if (!AutoClose) writeln('</head><body leftmargin = "0" topmargin = "0" bgcolor=ffffff scroll="no" onload="doTitle();self.focus()">') 

else writeln('</head><body leftmargin = "0" topmargin = "0" bgcolor=ffffff scroll="no" onload="doTitle();self.focus()">');

writeln('<img src = "http://www.luxaris.com/luxstores/send-to-friend.jpg"><center><form method="POST" action="http://www.luxstores.com/app/mail.php"><table width = "500" cellspacing = "5"><tr><td colspan = 2><font size="2" color="#314053" face="Arial, Helvetica, sans-serif">Want someone else to see this site? Use this form to send this page as a link and they will receive it immediately. Send it to several places/people by separating the email addresses with commas.</font></td></tr><tr>   <td><div align="right"><font size="2" color="#314053" face="Arial, Helvetica, sans-serif">Friends email</font></div></td><td><input type="text" size = "40" name="_recipients" id = "_recipients"></td>    <tr><td><div align="right"><font color="#314053" size="2" face="Arial, Helvetica, sans-serif">Subject</font></div></td><td><input type="Text" name="_subject" id = "_subject" size = "40" value="Take a look at this web page"></td></tr><tr><td><div align="right"><font color="#314053" face="Arial, Helvetica, sans-serif" size="2">Your Name</font></div></td><td><input name="realname" id = "realname" type="TEXT" size=40></td></tr><tr><td><div align="right"><font color="#314053" face="Arial, Helvetica, sans-serif" size="2">Your E-mail</font></div></td><td><input name="_replyTo" id = "_replyTo" type="TEXT" size=40></td></tr><tr><td colspan = 2><font size="2" color="#314053" face="Arial, Helvetica, sans-serif">Message<input type = "hidden" id = "_redirect" name = "_redirect" value = "http://site.bathroom-glass-vanities.com/thankyou.htm"></font></p><p><textarea name="_body" type="TEXT" rows=6 cols=45 align="left" wrap="physical">');

writeln('\n');

writeln('</textarea>');

writeln('<input type="hidden" name="hrefref" value="'+pageref+'">');

writeln('</p><p><input src = "http://www.luxaris.com/luxstores/butt-submit.jpg" name="Submit" id = "Submit" type="image" value="Submit">&nbsp; &nbsp;<a href = "javascript:window.close();"><img border = "0" src = "http://www.luxaris.com/luxstores/butt-close.jpg"></a></td></tr></table></form></body></center></html>');

close(); };}

// -- End Hiding Here --> 

function getRefToDivMod( divID, oDoc ) {

  if( !oDoc ) { oDoc = document; }

  if( document.layers ) {

    if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {

      for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {

        y = getRefToDivMod(divID,oDoc.layers[x].document); }

      return y; } }

  if( document.getElementById ) { return oDoc.getElementById(divID); }

  if( document.all ) { return oDoc.all[divID]; }

  return document[divID];

}



function openPerfectPopup(oW,oTitle,oContent) {

  var x = window.open('','windowName','width=500,height=400,resizable=1');

  if( !x ) { return true; }

  x.document.open();

  x.document.write('<html><head><title>'+oTitle+'<\/title><\/head><body>'+

    (document.layers?('<layer left="0" top="0" width="'+oW+'" id="myID">')

      :('<div style="position:absolute;left:0px;top:0px;display:table;width:'+oW+'px;" '+

      'id="myID">'))+

    oContent+(document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');

  x.document.close();

  var oH = getRefToDivMod( 'myID', x.document ); if( !oH ) { return false; }

  var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }

  x.resizeTo( oW + 200, oH + 200 );

  var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;

  if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }

  else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }

  else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }

  if( window.opera && !document.childNodes ) { myW += 16; }

  x.resizeTo( oW + ( ( oW + 200 ) - myW ), oH + ( (oH + 200 ) - myH ) );

  if( x.focus ) { x.focus(); }

  return false;

}

function TellFriend2(prio) {
    PositionX = 0;
    PositionY = 0;
    defaultWidth = 600;
    defaultHeight = 500;
    var AutoClose = true;
    
    var element = document.getElementById('regular');
    var retail = element == null ? '' : element.innerHTML.replace(/"/g, "''"); //substr(1) is to get rid of $ sign
    
    //if there is a sale then this element contains "our price" value, else it contains nothing
    var sale = document.getElementById('regularsale') == null ? '' : document.getElementById('regularsale').innerHTML.replace(/"/g, "''");
    
    //in case of sale this element contains "sale" value, in other case it contains "Our price"
    element = document.getElementById('dispprice');
    var dispprice = element == null ? '' : element.innerHTML.replace(/"/g, "''");
    
    element = document.getElementById('quick-ship');
    var quickShipping = element == null ? '' : element.innerHTML == '' ? false : true;
    
    element = document.getElementById('sku2')
    var itemNumber = element == null ? '' : element.innerHTML.replace(/"/g, "''");
    
    element = document.getElementById('h1');
    var itemName = element == null ? '' : element.innerHTML.replace(/"/g, "''"); //item name
    	
    element = document.getElementById('availability');
    var availability = element == null ? '' : element.innerHTML.replace(/"/g, "''");
    
    element = document.getElementById('logo');
    var img = element == null ? '' : element.getElementsByTagName('img')[0].src; //banner image
    
    //UpdateImage();
	//var itemImg = 'http://site.bathroom-glass-vanities.com/images/'+imageSource;
	element = document.PreviewImage;
    var itemImg = element == null ? '' : element.src;
    
    var target = ( itemName != '' && itemNumber != '' && retail != '' && dispprice != '') ? 'http://luxstores.com/app/mail/mail.php' : 'http://luxstores.com/app/mail.php';
    
    if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
        var isNN = (navigator.appName == "Netscape") ? 1 : 0;
        var isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
    } else {
        close();
    }
    var optNN = "status=yes,scrollbars=no,width=" + defaultWidth + ",height=" + defaultHeight + ",left=" + PositionX + ",top=" + PositionY;
    var optIE = "status=yes,scrollbars=yes,width=600,height=500,left=" + PositionX + ",top=" + PositionY;
    var pageref = location.href;
    if (isNN) {
        imgWin = window.open("about:blank", "", optNN);
    }
    if (isIE) {
        imgWin = window.open("1-888-666-1639", "", optIE);
    }
    with (imgWin.document) {
        writeln("<html><head><title>Loading...</title>");
        writeln("<script>");
        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 doTitle(){ document.title=\"Luxaris Home and Spa Store\";}");
        writeln("</script>");
        if (!AutoClose) {
            writeln("</head><body leftmargin = \"0\" topmargin = \"0\" bgcolor=ffffff scroll=\"no\" onload=\"doTitle();self.focus()\">");
        } else {
            writeln("</head><body leftmargin = \"0\" topmargin = \"0\" bgcolor=ffffff scroll=\"no\" onload=\"doTitle();self.focus()\">");
        }
        writeln("<img src = \"http://www.luxaris.com/luxstores/send-to-friend.jpg\"><center><form method=\"POST\" action=\""+target+"\"><table width = \"500\" cellspacing = \"5\"><tr><td colspan = 2><font size=\"2\" color=\"#314053\" face=\"Arial, Helvetica, sans-serif\">Want someone else to see this site and product? Use this form to send this page as a link and they will receive it immediately. Send it to several people by separating the email addresses with commas.</font></td></tr><tr>   <td><div align=\"right\"><font size=\"2\" color=\"#314053\" face=\"Arial, Helvetica, sans-serif\">Friend's E-mail</font></div></td><td><input type=\"text\" size = \"40\" name=\"_recipients\" id = \"_recipients\"></td>    <tr><td><div align=\"right\"><font color=\"#314053\" size=\"2\" face=\"Arial, Helvetica, sans-serif\">Subject</font></div></td><td><input type=\"Text\" name=\"_subject\" id = \"_subject\" size = \"40\" value=\"Take a look at this web page\"></td></tr><tr><td><div align=\"right\"><font color=\"#314053\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">Your Name</font></div></td><td><input name=\"realname\" id = \"realname\" type=\"TEXT\" size=40></td></tr><tr><td><div align=\"right\"><font color=\"#314053\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">Your E-mail</font></div></td><td><input name=\"_replyTo\" id = \"_replyTo\" type=\"TEXT\" size=40></td></tr><tr><td colspan = 2><font size=\"2\" color=\"#314053\" face=\"Arial, Helvetica, sans-serif\">Message<input type = \"hidden\" id = \"_redirect\" name = \"_redirect\" value = \"http://site.bathroom-glass-vanities.com/thankyou.htm\"></font></p><p><textarea name=\"_body\" type=\"TEXT\" rows=6 cols=45 align=\"left\" wrap=\"physical\">");
        writeln("</textarea>");
        writeln("<input type=\"hidden\" name=\"hrefref\" value=\"" + pageref.replace(/"/g, "''")  + "\">");
        
        writeln('<input type="hidden" name="retail" value="' + retail + '">');
        writeln('<input type="hidden" name="sale" value="' + sale + '">')
        writeln('<input type="hidden" name="dispprice" value="' + dispprice + '">')
        writeln('<input type="hidden" name="quickShipping" value="' + quickShipping  + '">');
        writeln('<input type="hidden" name="availability" value="' + availability + '">');
        writeln('<input type="hidden" name="bannerImage" value="' + img + '">');
        writeln('<input type="hidden" name="itemImg" value="' + itemImg + '">');
        
        writeln('<input type="hidden" name="itemName" value="' + itemName + '">');
        writeln('<input type="hidden" name="itemNumber" value="' + itemNumber + '">');
        writeln('<p style=\"color: rgb(49, 64, 83); font-family: arial,helvetica; font-size: 12px;\"><input type=\"checkbox\" checked=\"\" name=\"weekly_email\"/>Add my email to \"Specials & Coupons\" e-mail list</input></p>\t\t');
        
        writeln("</p><p><input src = \"http://www.luxaris.com/luxstores/butt-send-friend.jpg\" name=\"Submit\" id = \"Submit\" type=\"image\" value=\"Submit\">&nbsp; &nbsp;<a href = \"javascript:window.close();\"><img border = \"0\" src = \"http://www.luxaris.com/luxstores/butt-close.jpg\"></a></td></tr></table></form></body></center></html>");
        close();
    }
}