// javascript library for Damiani Wine Cellars website.
// jt@jt-mj.net   http://jt-mj.net

// iwin() - from:  http://www.htmlgoodies.com/ 
var image
var cond1,cond2
function iwin(image,tytle,width,height) {
        if (width==0) cond1=" "
                else cond1="width="+(width+20)+"";
        if (height==0) {cond2=" "}
                else {cond2="height="+(height+88)+""};

       var s1 ="<TITLE>"+tytle+"</TITLE>" 
       var s15=""
       var s2 ="<CENTER><IMG SRC='"+image+"' BORDER=0>"
       var s3 ="<p><FORM><INPUT TYPE='BUTTON' VALUE='Close'"+
                " onClick='self.close()'>"
       var s4 ="</FORM></CENTER></BODY>"

        ImageWindow=window.open("", "newwin",
        "toolbar=no,resizable=no,scrollbars=yes,menubar=no,"+cond1+","+cond2);
        ImageWindow.document.write(s1+s15+s2+s3+s4)
        ImageWindow.document.close()
}

//  begin drop box script - Added per SH 16Feb07 
/***********************************************
* Drop Down/ Overlapping Content-   Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
if (typeof opt_position!="undefined" && opt_position.indexOf("up")!=-1)
   { ypos = ypos - 100; }
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}
<!-- end drop box script -->

