// -------------------------------------------------------------------

// Image Thumbnail Viewer Script- By Dynamic Drive, available at: http://www.dynamicdrive.com

// Last updated: July 7th, 2008- Fixed enlarged image not showing in IE sometimes

// -------------------------------------------------------------------



var popbox={

enableTitle: true, //Should "title" attribute of link be used as description?

enableAnimation: true, //Enable fading animation?

definefooter: '<div class="footerbar" onClick="popbox.closeit()" style="">X</div>', //Define HTML for footer interface

defineLoading: '<div align="center"><img src="'+websiteURL+'images/loading.gif" /><br /> Se incarca...</div>', //Define HTML for "loading" div



/////////////No need to edit beyond here/////////////////////////



scrollbarwidth: 16,

createpopBox:function(){

//write out HTML for Image Thumbnail Viewer plus loading div

newsHTML = '\
<div style="padding: 10px;">\
    <table border="0" cellpadding="0" cellspacing="0">\
    <tr>\
        <td>\
            <h1>Luminence</h1>\
            <p>Aparat Epilare Definitiva IPL si Fotoreintinerire</b><p>\
            <h2>Epilare Definitiva:</h2>\
            <p>Lumina intensa pulsata, filtrata la 610 nm, incalzeste melanina din par, provocand coagularea proteinelor din papila foliculara si ducand astefl la eliminarea progresiva a firelor de par.</p>\
            <h2>Fotoreintinerire</h2>\
            <p>Lumina intensa pulsata, filtrata la 475 nm este absorbita de hemoglobina si melanina. Actioneaza astfel asupra varicozitatilor, cat si asupra petelor de pigmentare si refacerea colagenului din tesuturi.</p>\
            <h2>Oferta</h2>\
            <p><b>Pret lista</b>: <span style="font-size: 16px; text-decoration: line-through;">28000 Euro + TVA</span><br />\
            <b>Pret oferta aparat Showroom</b>: <span class="on" style="font-size: 16px;">14000 Euro + TVA</span><br />\
            An fabricatie: 2007<br />\
            Tara de origine: Franta<br />\
            Producator: Multiwell SARL</p>\
        </td>\
        <td valign="top" align="center">\
            <img style="float: right;" src="'+websiteURL+'images/aparat.luminence.thumb.jpg" alt="" /><br clear="all" /><br /><br />\
            <input type="button" value="Oferta detaliata &raquo;" onclick="document.location.href = \'http://www.seetrybuy.ro/index.php?page=oferta\';" />\
        </td>\
    </tr>\
    </table>\
</div>';

            

document.write('<div id="popForm">'+this.definefooter+newsHTML+'</div>')

document.write('<div id="popLoading">'+this.defineLoading+'</div>')

this.popBox=document.getElementById("popForm")

this.popLoading=document.getElementById("popLoading") //Reference "loading" div that will be shown while image is fetched

this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes

},





centerDiv:function(divobj){ //Centers a div element on the page

var ie=document.all && !window.opera

var dom=document.getElementById

var scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset

var scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset

var docwidth=(ie)? this.standardbody.clientWidth : window.innerWidth-this.scrollbarwidth

var docheight=(ie)? this.standardbody.clientHeight: window.innerHeight

var docheightcomplete=(this.standardbody.offsetHeight>this.standardbody.scrollHeight)? this.standardbody.offsetHeight : this.standardbody.scrollHeight //Full scroll height of document

var objwidth=divobj.offsetWidth //width of div element

var objheight=divobj.offsetHeight //height of div element

var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+10+"px" //Vertical position of div element: Either centered, or if element height larger than viewpoint height, 10px from top of viewpoint

divobj.style.left=docwidth/2-objwidth/2+"px" //Center div element horizontally

divobj.style.top=Math.floor(parseInt(topposition))+"px"

divobj.style.visibility="visible"

},



showpopBox:function(){ //Show ThumbBox div

popbox.popLoading.style.visibility="hidden" //Hide "loading" div

this.centerDiv(this.popBox)

},





loadimage:function(link){ //Load image function that gets attached to each link on the page with rel="thumbnail"

if (this.popBox.style.visibility=="visible") //if thumbox is visible on the page already

this.closeit() //Hide it first (not doing so causes triggers some positioning bug in Firefox

this.centerDiv(this.popLoading) //Center and display "loading" div while we set up the image to be shown

setTimeout("popbox.showpopBox()",1000);

},



closeit:function(){ //Close "thumbbox" div function

this.popBox.style.visibility="hidden"

this.popBox.style.left="-2000px"

this.popBox.style.top="-2000px"

},



cleanup:function(){ //Clean up routine on page unload

this.popLoading=null

this.popBox=null

},



dotask:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)

var tasktype=(window.addEventListener)? tasktype : "on"+tasktype

if (target.addEventListener)

target.addEventListener(tasktype, functionref, false)

else if (target.attachEvent)

target.attachEvent(tasktype, functionref)

}



}



popbox.createpopBox() //Output HTML for the image thumbnail viewer

popbox.dotask(window, function(){popbox.cleanup()}, "unload")
