/* scriptİ 2000 - 2001, HFS-Design. All Rights Resered. */

function FlexsLayer(id,nestref,frame) 
	{
        if (!is.ns5 && !FlexsLayer.set && !frame) FlexsLayerInit()
        this.frame = frame || self
        if (is.ns) 
		{
                if (is.ns4_7up) 
			{
                        if (!frame) 
				{
                                if (!nestref) var nestref = FlexsLayer.nestRefArray[id]
                                if (!FlexsLayerTest(id,nestref)) return
                                this.css = (nestref)? eval("document."+nestref+".document."+id) : document.layers[id]
                                }
                        else this.css = (nestref)? eval("frame.document."+nestref+".document."+id) : frame.document.layers[id]
                        this.elm = this.event = this.css
                        this.doc = this.css.document
                        }
             	else if (is.ns5) 
			{
                        this.elm = document.getElementById(id)
                        this.css = this.elm.style
                        this.doc = document
                        }
              	this.x = this.css.left
                this.y = this.css.top
                this.w = this.css.clip.width
                this.h = this.css.clip.height
                }
     	else if (is.ie) 
		{
                this.elm = this.event = this.frame.document.all[id]
                this.css = this.frame.document.all[id].style
                this.doc = document
                this.x = this.elm.offsetLeft
                this.y = this.elm.offsetTop
                this.w = (is.ie4)? this.css.pixelWidth : this.elm.offsetWidth
                this.h = (is.ie4)? this.css.pixelHeight : this.elm.offsetHeight
                }
     	this.id = id
        this.nestref = nestref
        this.obj = id + "FlexsLayer"
        eval(this.obj + "=this")
        }

function FlexsLayerMoveTo(x,y) 
	{
        if (x!=null) 
		{
                this.x = x
                if (is.ns) this.css.left = this.x
                else this.css.pixelLeft = this.x
                }
      	if (y!=null) 
		{
                this.y = y
                if (is.ns) this.css.top = this.y
                else this.css.pixelTop = this.y
                }
        }

function FlexsLayerMoveBy(x,y) 
	{
        this.moveTo(this.x+x,this.y+y)
        }

function FlexsLayerShow() 
	{
        this.css.visibility = (is.ns4_7up)? "show" : "visible"
        }

function FlexsLayerHide() 
	{
        this.css.visibility = (is.ns4_7up)? "hide" : "hidden"
        }

FlexsLayer.prototype.moveTo = FlexsLayerMoveTo
FlexsLayer.prototype.moveBy = FlexsLayerMoveBy
FlexsLayer.prototype.show = FlexsLayerShow
FlexsLayer.prototype.hide = FlexsLayerHide
FlexsLayerTest = new Function('return true')

function FlexsLayerInit(nestref) 
	{
        if (!FlexsLayer.set) FlexsLayer.set = true
        if (is.ns) 
		{
                if (nestref) ref = eval('document.'+nestref+'.document')
                else {nestref = ''; ref = document;}
                        for (var i=0; i<ref.layers.length; i++) 
				{
                                var divname = ref.layers[i].name
                                FlexsLayer.nestRefArray[divname] = nestref
                                var index = divname.indexOf("Div")
                                if (index > 0) 
					{
                                        eval(divname.substr(0,index)+' = new FlexsLayer("'+divname+'","'+nestref+'")')
                                }
                                if (ref.layers[i].document.layers.length > 0) 
					{
                                        FlexsLayer.refArray[FlexsLayer.refArray.length] = (nestref=='')? ref.layers[i].name : nestref+'.document.'+ref.layers[i].name
                                }
                        }
                        if (FlexsLayer.refArray.i < FlexsLayer.refArray.length) 
				{
                                FlexsLayerInit(FlexsLayer.refArray[FlexsLayer.refArray.i++])
                        }
                }
     	else if (is.ie) 
		{
                for (var i=0; i<document.all.tags("DIV").length; i++) 
			{
                        var divname = document.all.tags("DIV")[i].id
                        var index = divname.indexOf("Div")
                        if (index > 0) 
				{
                                eval(divname.substr(0,index)+' = new FlexsLayer("'+divname+'")')
                                }
                        }
                }
                return true
        }

FlexsLayer.nestRefArray = new Array()
FlexsLayer.refArray = new Array()
FlexsLayer.refArray.i = 0
FlexsLayer.set = false

function FlexsLayerSlideTo(endx,endy,inc,speed,fn) 
	{
        if (endx==null) endx = this.x
        if (endy==null) endy = this.y
        var distx = endx-this.x
        var disty = endy-this.y
        this.slideStart(endx,endy,distx,disty,inc,speed,fn)
        }

function FlexsLayerSlideBy(distx,disty,inc,speed,fn) 
	{
        var endx = this.x + distx
        var endy = this.y + disty
        this.slideStart(endx,endy,distx,disty,inc,speed,fn)
        }

function FlexsLayerSlideStart(endx,endy,distx,disty,inc,speed,fn) 
	{
        if (this.slideActive) return
        var num = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2))/inc
        if (num==0) return
        var dx = distx/num
        var dy = disty/num
        if (!fn) fn = null
        this.slideActive = true
        this.slide(dx,dy,endx,endy,num,1,speed,fn)
        }

function FlexsLayerSlide(dx,dy,endx,endy,num,i,speed,fn) 
	{
        if (!this.slideActive) return
        if (i++ < num) 
		{
                this.moveBy(dx,dy)
                this.onSlide()
                if (this.slideActive) setTimeout(this.obj+".slide("+dx+","+dy+","+endx+","+endy+","+num+","+i+","+speed+",\""+fn+"\")",speed)
                else this.onSlideEnd()
                }
       	else 
		{
                this.slideActive = false
                this.moveTo(endx,endy)
                this.onSlide()
                this.onSlideEnd()
                eval(fn)
                }
        }

function FlexsLayerSlideInit() {}
FlexsLayer.prototype.slideInit = FlexsLayerSlideInit
FlexsLayer.prototype.slideTo = FlexsLayerSlideTo
FlexsLayer.prototype.slideBy = FlexsLayerSlideBy
FlexsLayer.prototype.slideStart = FlexsLayerSlideStart
FlexsLayer.prototype.slide = FlexsLayerSlide
FlexsLayer.prototype.onSlide = new Function()
FlexsLayer.prototype.onSlideEnd = new Function()

function FlexsLayerClipInit(clipTop,clipRight,clipBottom,clipLeft) 
	{
        if (is.ie) 
		{
                if (arguments.length==4) this.clipTo(clipTop,clipRight,clipBottom,clipLeft)
                else if (is.ie4) this.clipTo(0,this.css.pixelWidth,this.css.pixelHeight,0)
                }
        }

function FlexsLayerClipTo(t,r,b,l) 
	{
        if (t==null) t = this.clipValues('t')
        if (r==null) r = this.clipValues('r')
        if (b==null) b = this.clipValues('b')
        if (l==null) l = this.clipValues('l')
        if (is.ns) 
		{
                this.css.clip.top = t
                this.css.clip.right = r
                this.css.clip.bottom = b
                this.css.clip.left = l
                }
        else if (is.ie) this.css.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)"
        }

function FlexsLayerClipBy(t,r,b,l) 
	{
        this.clipTo(this.clipValues('t')+t,this.clipValues('r')+r,this.clipValues('b')+b,this.clipValues('l')+l)
        }

function FlexsLayerClipValues(which) 
	{
        if (is.ie) var clipv = this.css.clip.split("rect(")[1].split(")")[0].split("px")
        if (which=="t") return (is.ns)? this.css.clip.top : Number(clipv[0])
        if (which=="r") return (is.ns)? this.css.clip.right : Number(clipv[1])
        if (which=="b") return (is.ns)? this.css.clip.bottom : Number(clipv[2])
        if (which=="l") return (is.ns)? this.css.clip.left : Number(clipv[3])
        }

FlexsLayer.prototype.clipInit = FlexsLayerClipInit
FlexsLayer.prototype.clipTo = FlexsLayerClipTo
FlexsLayer.prototype.clipBy = FlexsLayerClipBy
FlexsLayer.prototype.clipValues = FlexsLayerClipValues

function FlexsLayerWrite(html) 
	{
        if (is.ns) 
		{
                this.doc.open()
                this.doc.write(html)
                this.doc.close()
                }
      	else if (is.ie) 
		{
                this.event.innerHTML = html
                }
        }

FlexsLayer.prototype.write = FlexsLayerWrite

function FlexsLayerWipeInit(clipTop,clipRight,clipBottom,clipLeft) 
	{
        if (arguments.length==4) this.clipInit(clipTop,clipRight,clipBottom,clipLeft)
        else this.clipInit()
        }

function FlexsLayerWipeTo(endt,endr,endb,endl,num,speed,fn) 
	{
        var distt = (endt!=null)? endt-this.clipValues('t'):0
        var distr = (endr!=null)? endr-this.clipValues('r'):0
        var distb = (endb!=null)? endb-this.clipValues('b'):0
        var distl = (endl!=null)? endl-this.clipValues('l'):0
        this.wipeStart(distt,distr,distb,distl,endt,endr,endb,endl,num,speed,fn)
        }

function FlexsLayerWipeBy(distt,distr,distb,distl,num,speed,fn) 
	{
        this.wipeStart(distt,distr,distb,distl,distt+this.clipValues('t'),distr+this.clipValues('r'),distb+this.clipValues('b'),distl+this.clipValues('l'),num,speed,fn)
        }

function FlexsLayerWipeStart(distt,distr,distb,distl,endt,endr,endb,endl,num,speed,fn) 
	{
        if (this.wipeActive) return
        if (!fn) fn = null
        this.wipeActive = true
        this.wipe(distt/num,distr/num,distb/num,distl/num,endt,endr,endb,endl,this.clipValues('t'),this.clipValues('r'),this.clipValues('b'),this.clipValues('l'),num,1,speed,fn)
        }

function FlexsLayerWipe(dt,dr,db,dl,endt,endr,endb,endl,st,sr,sb,sl,num,i,speed,fn) 
	{
        if (!this.wipeActive) return
        if (i++ < num) 
		{
                this.clipTo(st+i*dt,sr+i*dr,sb+i*db,sl+i*dl)
		this.onWipe()
                if (this.wipeActive) setTimeout(this.obj+".wipe("+dt+","+dr+","+db+","+dl+","+endt+","+endr+","+endb+","+endl+","+st+","+sr+","+sb+","+sl+","+num+","+i+","+speed+",\""+fn+"\")",speed)
                else this.onWipeEnd()
		}
      	else 
		{
                this.wipeActive = false
                this.clipTo(endt,endr,endb,endl)
		this.onWipe()
		this.onWipeEnd()
                eval(fn)        
                }
        }

FlexsLayer.prototype.wipeInit = FlexsLayerWipeInit
FlexsLayer.prototype.wipeTo = FlexsLayerWipeTo
FlexsLayer.prototype.wipeBy = FlexsLayerWipeBy
FlexsLayer.prototype.wipeStart = FlexsLayerWipeStart
FlexsLayer.prototype.wipe = FlexsLayerWipe
FlexsLayer.prototype.onWipe = new Function()
FlexsLayer.prototype.onWipeEnd = new Function()

function BrowserCheck()
	{
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.vminor = parseFloat(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4_7up = (this.b=="ns" && this.vminor>=4.7 && this.vminor<5.0)
	this.ns5 = (this.b=="ns" && this.v>=5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5up = (navigator.userAgent.indexOf('MSIE 5')>5 || navigator.userAgent.indexOf('MSIE 6')>6)
	}

is = new BrowserCheck();

function createLayer(id,nestref,left,top,width,height,content,bgColor,visibility,zIndex) 
	{
        if (is.ns) 
		{
                if (nestref) 
			{
                        var lyr = eval("document."+nestref+".document."+id+" = new Layer(width, document."+nestref+")")
                        }
               	else 
			{
                        var lyr = document.layers[id] = new Layer(width)
                        eval("document."+id+" = lyr")
                        }
              	lyr.name = id
       	        lyr.left = left
              	lyr.top = top
		if (width!=null) lyr.clip.width = width
                if (height!=null) lyr.clip.height = height
                if (bgColor!=null) lyr.bgColor = bgColor
                lyr.visibility = (visibility=='hidden')? 'hide' : 'show'
                if (zIndex!=null) lyr.zIndex = zIndex
                if (content) 
			{
                        lyr.document.open()
                        lyr.document.write(content)
                        lyr.document.close()
                        }
                }
    	else if (is.ie) 
		{
               	var str = '\n<DIV id='+id+' style="position:absolute; left:'+left+'; top:'+top+'; width:'+width
               	if (height!=null) 
			{
                        str += '; height:'+height
                        str += '; clip:rect(0,'+width+','+height+',0)'
                        }
               	if (bgColor!=null) str += '; background-color:'+bgColor         
              	if (zIndex!=null) str += '; z-index:'+zIndex
               	if (visibility) str += '; visibility:'+visibility
                str += ';">'+((content)?content:'')+'</DIV>'
               	if (nestref) 
			{
                        index = nestref.lastIndexOf(".")
                        var nestlyr = (index != -1)? nestref.substr(index+1) : nestref
                        document.all[nestlyr].insertAdjacentHTML("BeforeEnd",str);
                        }
               	else 
			{
                        document.body.insertAdjacentHTML("BeforeEnd",str)
                        }
                }
        }

function destroyLayer(id,nestref) 
	{
      	if (is.ns) 
		{
                if (nestref) eval("document."+nestref+".document."+id+".visibility = 'hide'")
                else document.layers[id].visibility = "hide"
                }
    	else if (is.ie) 
		{
                document.all[id].innerHTML = ""
                document.all[id].outerHTML = ""
                }
        }