// Copyright(C)2010 CSSMenuTools. All rights reserved.
// http://www.cssmenutools.com
//ProductID:MTLB
// Registered to:JohnHaddad
var QfPDILC={dummy:0,
VERSION:'1.0.3.0',
CSS_Placement:2,
PreloadImage:'&../ajax-loader.gif',
Position:0,
X:100,
Y:100,
Is_Fixed:false,
Width:435,
Height:485,
IsZoom:false,
IsClickClose:false,
BGColor:'#000000',
BorderStyle:'image',
BorderColor:'#c0c0c0',
BorderWidth:2,
ShadeColor:'#000000',
ShadeOpacity:70,
TBarHeight:50,
TBarAlignment:1,
TBarColor:'#000000',
TBarImage:'',
TBarFont:'Verdana,Arial,Helvetica,sans-serif',
TBarFontSize:13,
TBarItalic:true,
TBarBold:true,
TBarFontColor:'#c0c0c0',
TBarIconPrev:'&../mtlb_prev.gif',
TBarIconPrevMO:'&../mtlb_prevmo.gif',
TBarIconNext:'&../mtlb_next.gif',
TBarIconNextMO:'&../mtlb_nextmo.gif',
TBarIconClose:'&../mtlb_close.gif',
TBarIconCloseMO:'&../mtlb_closemo.gif',
TLImage:'&../mtlb_top_left.png',
TImage:'&../mtlb_top.png',
TRImage:'&../mtlb_top_right.png',
LImage:'&../mtlb_left.png',
RImage:'&../mtlb_right.png',
BLImage:'&../mtlb_bottom_left.png',
BImage:'&../mtlb_bottom.png',
BRImage:'&../mtlb_bottom_right.png',
HTImage:12,
HBImage:12,
WLImage:12,
WRImage:12,
END_PARAMETERS:1,
CurrList:null,
CurrInd:0,
PreloadImg:null,
browser:function(){var ua=navigator.userAgent.toLowerCase()
var ind=ua.indexOf('gecko')
this.opera=ua.indexOf('opera')>=0
this.safari=ua.indexOf('safari')>=0
this.ie=document.all&&!this.opera
this.compatMode=document.compatMode=="CSS1Compat"
this.ieCanvas=this.compatMode?document.documentElement:document.body
return this},
setPathAdjustment:function(ID){var sl=''
var sc=document.getElementsByTagName('script')
for(var i=0;i<sc.length;i++){if(sc[i].innerHTML.search(ID)>-1)sl=sc[i].src}this.SCRIPT_LOCATION=sl.substr(0, sl.lastIndexOf('/')+1)},
adjustPath:function(path){var idf=path.charAt(0)
if(idf=='*'||idf=='&')return this.SCRIPT_LOCATION+path.substr(1)
return path},
addLoadEvent:function(f){var done=0
function w(){if(!done){done=1
f()}}if(document.addEventListener){document.addEventListener('DOMContentLoaded', w, false)}if(this.br.ie&&window==top)(function(){try{document.documentElement.doScroll('left')}catch(e){setTimeout(arguments.callee, 0)
return}w()})()
var oldf=window.onload
if(typeof oldf!='function'){window.onload=w}else{window.onload=function(){try{oldf()}catch(e){}w()}}},
addResizeEvent:function(f){var oldf=window.onresize
if(typeof oldf!='function'){window.onresize=f}else{window.onresize=function(){try{oldf()}catch(e){}f()}}},
addScrollEvent:function(f){var oldf=window.onscroll
if(typeof oldf!='function'){window.onscroll=f}else{window.onscroll=function(){try{oldf()}catch(e){}f()}}},
init:function(){var m=this
m.br=new m.browser
this.setPathAdjustment('MTLB_QfPDILC')
m.addLoadEvent(m.onload)
m.addResizeEvent(m.oResize)
m.addScrollEvent(m.oScroll)},
onload:function(){setTimeout('QfPDILC.start()',0)},
start:function(){var m=this
m.TBarIconPrev=m.adjustPath(m.TBarIconPrev)
m.TBarIconPrevMO=m.adjustPath(m.TBarIconPrevMO)
m.TBarIconNext=m.adjustPath(m.TBarIconNext)
m.TBarIconNextMO=m.adjustPath(m.TBarIconNextMO)
m.TBarIconClose=m.adjustPath(m.TBarIconClose)
m.TBarIconCloseMO=m.adjustPath(m.TBarIconCloseMO)
var targets=document.getElementsByName('MTLB_QfPDILC')
for(var i=0;i<targets.length;i++){targets[i].onclick=this.show}},
show:function(){var m=QfPDILC
var e=this
m.CurrList=eval(e.id+'list');var len=m.CurrList.length
 if(len==0)return false;for(var i=0;i<len;i++)m.CurrList[i][0]=m.adjustPath(m.CurrList[i][0])
m.CurrInd=0;if(m.wrapDiv){m.overlay.style.display='block'
m.wrapDiv.parentNode.style.display=''
m.wrapDiv.style.display='block'}else{m.create();m.updatePos();}m.changeImage(m.CurrList[m.CurrInd])
return false},
create:function(){var m=this
 m.PreloadImg=new Image()
m.PreloadImg.onload=m.onloadImg
m.overlay=document.createElement('div')
var stl=m.overlay.style
if(m.br.ie){var pageSize=new m.getPageSize()
var scrollPos=new m.getScrollPos()
stl.left=scrollPos.scrollX+'px'
stl.top=scrollPos.scrollY+'px'
stl.position='absolute'
stl.width=pageSize.winWidth+scrollPos.scrollX+'px'
stl.height=pageSize.winHeight+scrollPos.scrollY+'px'}else{stl.position='fixed'
stl.left='0px'
stl.top='0px'
stl.width='100%'
stl.height='100%'}stl.zIndex=1000
stl.backgroundColor='#000000'
if(m.br.ie)stl.filter='alpha(opacity=70)'
else stl.opacity=0.70
m.parentDiv=document.createElement('div')
stl=m.parentDiv.style
stl.position='absolute'
stl.left='0px'
stl.top='0px'
stl.width='100%'
stl.height='100%'
stl.zIndex=1001
stl.backgroundColor='transparent'
m.wrapDiv=document.createElement('div')
stl=m.wrapDiv.style
stl.zIndex=1001
stl.width=m.Width+m.WLImage+m.WRImage+'px'
stl.height=m.Height+m.HTImage+m.HBImage+'px'
stl.position='relative'
stl.margin='auto'
m.TLDiv=document.createElement('div')
m.TLDiv.className='MTLBQfPDILCtl'
m.TDiv=document.createElement('div')
m.TDiv.className='MTLBQfPDILCtop'
stl=m.TDiv.style
stl.width=m.Width+'px'
m.TRDiv=document.createElement('div')
m.TRDiv.className='MTLBQfPDILCtr'
m.LDiv=document.createElement('div')
m.LDiv.className='MTLBQfPDILCleft'
stl=m.LDiv.style
stl.height=m.Height+'px'
m.RDiv=document.createElement('div')
m.RDiv.className='MTLBQfPDILCright'
stl=m.RDiv.style
stl.height=m.Height+'px'
m.BLDiv=document.createElement('div')
m.BLDiv.className='MTLBQfPDILCbl'
m.BDiv=document.createElement('div')
m.BDiv.className='MTLBQfPDILCbottom'
stl=m.BDiv.style
stl.width=m.Width+'px'
m.BRDiv=document.createElement('div')
m.BRDiv.className='MTLBQfPDILCbr'
m.lbox=document.createElement('div')
stl=m.lbox.style
stl.width=m.Width+'px'
stl.height=m.Height+'px'
stl.position='absolute'
stl.top=m.HTImage+'px'
stl.left=m.WLImage+'px'
stl.zIndex=1001
stl.borderStyle='none'
var lboxHTML="<div class=\"MTLBQfPDILCcontent\"><div class=\"MTLBQfPDILCpreloader\" id=\"MTLBQfPDILCpreloader\"></div><img class=\"MTLBQfPDILCimage\" id=\"MTLBQfPDILCimg\" src=\"\" alt=\"\"/></div><div class=\"MTLBQfPDILCtitlebar\"><div class=\"MTLBQfPDILCtext\" id=\"MTLBQfPDILCtext\">"+m.CurrList[0][1]+"</div><div class=\"MTLBQfPDILCicons\" id=\"MTLBQfPDILCicons\"><img class=\"MTLBQfPDILCicon MTLBQfPDILCprev\" src=\""+m.TBarIconPrev+"\" alt=\"Previous\" onmouseover=\"this.src='"+m.TBarIconPrevMO+"'\" onmouseout=\"this.src='"+m.TBarIconPrev+"'\" onclick=\"QfPDILC.prev();\" /><img class=\"MTLBQfPDILCicon MTLBQfPDILCnext\" src=\""+m.TBarIconNext+"\" alt=\"Next\" onmouseover=\"this.src='"+m.TBarIconNextMO+"'\" onmouseout=\"this.src='"+m.TBarIconNext+"'\" onclick=\"QfPDILC.next();\" /><img class=\"MTLBQfPDILCicon MTLBQfPDILCclose\" src=\""+m.TBarIconClose+"\" alt=\"Close\" onmouseover=\"this.src='"+m.TBarIconCloseMO+"'\" onmouseout=\"this.src='"+m.TBarIconClose+"'\" onclick=\"QfPDILC.close();\" /></div></div>"
m.lbox.innerHTML=lboxHTML
document.body.appendChild(m.overlay)
document.body.appendChild(m.parentDiv)
m.parentDiv.appendChild(m.wrapDiv)
var p=m.wrapDiv
p.appendChild(m.TLDiv)
p.appendChild(m.TDiv)
p.appendChild(m.TRDiv)
p.appendChild(m.LDiv)
p.appendChild(m.lbox)
p.appendChild(m.RDiv)
p.appendChild(m.BLDiv)
p.appendChild(m.BDiv)
p.appendChild(m.BRDiv)
m.image=document.getElementById('MTLBQfPDILCimg')
m.preloader=document.getElementById('MTLBQfPDILCpreloader')
m.text=document.getElementById('MTLBQfPDILCtext')
m.icons=document.getElementById('MTLBQfPDILCicons')},
prev:function(){var m=QfPDILC
if(m.CurrList!=null){var len=m.CurrList.length
m.CurrInd=m.CurrInd>0 ? m.CurrInd-1:len-1
if(m.CurrInd>=0&&m.CurrInd<len){this.changeImage(m.CurrList[m.CurrInd])}}},
next:function(){var m=QfPDILC
if(m.CurrList!=null){var len=m.CurrList.length
m.CurrInd=m.CurrInd<len-1 ? m.CurrInd+1:0
if(m.CurrInd>=0&&m.CurrInd<len){this.changeImage(m.CurrList[m.CurrInd])}}},
close:function(){var m=QfPDILC
m.image.src=''
m.image.style.display='none'
m.wrapDiv.parentNode.style.display='none'
m.wrapDiv.style.display='none'
m.overlay.style.display='none'
m.CurrList=null;},
changeImage:function(arr){var m=this
if(m.image)m.image.style.display='none'
m.preloader.style.display='block'
if(m.text)m.text.innerHTML=m.CurrList[m.CurrInd][1]
m.PreloadImg.src=''
m.PreloadImg.src=arr[0]},
setSize:function(imgWidth, imgHeight){var m=this
m.lbox.style.width='auto'
var tbWidth=(m.text?m.text.offsetWidth:0)+(m.icons?m.icons.offsetWidth:0)
m.Width=tbWidth>imgWidth?tbWidth:imgWidth
m.Height=imgHeight+m.TBarHeight
m.wrapDiv.style.width=m.Width+'px'
m.wrapDiv.style.height=m.Height+'px'
if(m.image)m.image.parentNode.style.height=imgHeight+'px'
m.wrapDiv.style.width=m.Width+m.WLImage+m.WRImage+'px'
m.wrapDiv.style.height=m.Height+m.HTImage+m.HBImage+'px'
 m.lbox.style.width=m.Width+'px'
 m.lbox.style.height=m.Height+'px'
m.TDiv.style.width=m.Width+'px'
m.BDiv.style.width=m.TDiv.style.width
m.LDiv.style.height=m.Height+'px'
m.RDiv.style.height=m.LDiv.style.height
m.image.style.width=imgWidth+'px'
m.image.style.height=imgHeight+'px'},
setImagePos:function(imgWidth, imgHeight){var m=this
if(!m.image)return
var W=m.Width
var H=m.Height-m.TBarHeight
m.image.style.left=(W>imgWidth?(W-imgWidth)/2:0)+'px'
m.image.style.top=(H>imgHeight?(H-imgHeight)/2:0)+'px'},
onloadImg:function(){var m=QfPDILC
if(m.image)m.image.src=m.CurrList[m.CurrInd][0]
if(m.text)m.text.innerHTML=m.CurrList[m.CurrInd][1]
if(m.text)m.text.style.marginTop=((m.TBarHeight-m.text.offsetHeight)/2)+'px'
if(m.preloader)m.preloader.style.display='none'
m.setSize(m.PreloadImg.width, m.PreloadImg.height)
m.setImagePos(m.PreloadImg.width, m.PreloadImg.height)
if(m.image)m.image.style.display='inline'
m.updatePos()
m.updateOverlay()},
updatePos:function(){var m=QfPDILC
if(m.wrapDiv&&m.wrapDiv.style.display!='none'){var pageSize=new m.getPageSize()
var scrollPos=new m.getScrollPos()
var pos
if(m.wrapDiv.offsetHeight<pageSize.winHeight){pos=Math.round(pageSize.winHeight/2+scrollPos.scrollY-m.wrapDiv.offsetHeight/2)+'px'}else{pos=Math.round(pageSize.winHeight/2-m.wrapDiv.offsetHeight/2)+'px'}if(pos!=m.wrapDiv.style.top)m.wrapDiv.style.top=pos
if(m.wrapDiv.offsetWidth<pageSize.width){pos=scrollPos.scrollX+'px'
if(pos!=m.wrapDiv.style.left)m.wrapDiv.style.left=pos}}},
updateOverlay:function(isResize){var m=QfPDILC
if(m.lbox&&m.lbox.style.display!='none'){if(m.br.ie){var pageSize=new m.getPageSize()
var scrollPos=new m.getScrollPos()
m.overlay.style.left=scrollPos.scrollX+'px'
m.overlay.style.top=scrollPos.scrollY+'px'
m.overlay.style.width=pageSize.winWidth+'px'
m.overlay.style.height=pageSize.winHeight+'px'}}},
oResize:function(){var m=QfPDILC
m.updatePos()
m.updateOverlay()},
oScroll:function(){var m=QfPDILC
m.updatePos()
m.updateOverlay()},
getPageSize:function(){var xScroll, yScroll
var d=document
var docElem=d.documentElement
if(self.innerHeight&&self.scrollMaxY){yScroll=self.innerHeight+self.scrollMaxY}else if(d.body.scrollHeight>d.body.offsetHeight){yScroll=d.body.scrollHeight}else if(docElem&&docElem.scrollHeight>docElem.offsetHeight){yScroll=docElem.scrollHeight}else{yScroll=d.body.offsetHeight}if(self.innerWidth&&self.scrollMaxX){xScroll=self.innerWidth+self.scrollMaxX}else if(d.body.scrollWidth>d.body.offsetWidth){xScroll=d.body.scrollWidth}else if(docElem&&docElem.scrollWidth>docElem.offsetWidth){xScroll=docElem.scrollWidth}else{xScroll=d.body.offsetWidth}var windowWidth, windowHeight
if(self.innerHeight){windowWidth=self.innerWidth
windowHeight=self.innerHeight}else if(docElem&&docElem.clientHeight){windowWidth=docElem.clientWidth
windowHeight=docElem.clientHeight}else if(d.body){windowWidth=d.body.clientWidth
windowHeight=d.body.clientHeight}this.winHeight=windowHeight
this.winWidth=windowWidth
this.pageHeight=yScroll
this.pageWidth=xScroll},
getScrollPos:function(){var docElem=document.documentElement
this.scrollX=self.scrollX||(docElem&&docElem.scrollLeft)||document.body.scrollLeft
this.scrollY=self.scrollY||(docElem&&docElem.scrollTop)||document.body.scrollTop},
dummy:null};QfPDILC.init()

