function openmessage(){
    var count_winit = GetCookie('count_winit');
    winit(1,1,402,302,300,150);
    if (count_winit>0){oWin[0].minimize();}
    //document.cookie="count_winit=1";
}

function GetCookie (name) { 
var arg = name + "="; 
var alen = arg.length; 
var clen = document.cookie.length; 
var m = 0; 
while (m < clen) { 
var j = m + alen; 
if (document.cookie.substring(m, j) == arg) 
return getCookieVal (j); 
m = document.cookie.indexOf(" ", m) + 1; 
if (m == 0) break; 
} 
return null;
}

function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

/************************************************************************************
Simple reusable DHTML library made by Thomas Brattli from www.bratta.com
Please keep this notice in the code if you use it. Thanks.
bratta-dhtml-lib ver 1
************************************************************************************/
function lib_bwcheck(){
	this.ver=navigator.appVersion; this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0; this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1; this.opera=this.agent.indexOf("Opera")>-1
	this.opera5=this.agent.indexOf("Opera 5")>-1; 
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera4)
	return this
}
var bw=new lib_bwcheck(); //if(!bw.bw) location.href='sorry.html'
function lib_doc_size(){
	this.x=0;this.x2=bw.ie && document.body.offsetWidth-20||innerWidth||0;
	this.y=0;this.y2=bw.ie && document.body.offsetHeight-5||innerHeight-12||0;
	if(bw.ns6) this.x2-=15
	if(!this.x2||!this.y2) return message('Document has no width or height') 
	this.x50=this.x2/2;this.y50=this.y2/2;
	this.x10=(this.x2*10)/100;this.y10=(this.y2*10)/100
	this.ytop=140*100/this.y2
	this.avail=(this.y2*(100-this.ytop))/100
	this.origy=this.y2
	return this;
}
function lib_message(txt){alert(txt); return false}
function lib_moveIt(x,y){this.x=x;this.y=y; this.css.left=x;this.css.top=y}
function lib_moveBy(x,y){this.moveIt(this.x+x,this.y+y)}
function lib_showIt(){this.css.visibility="visible"}
function lib_hideIt(){this.css.visibility="hidden"}
function lib_bg(color){
	if(bw.opera) this.css.background=color
	else if(bw.dom || bw.ie4) this.css.backgroundColor=color
	else if(bw.ns4) this.css.bgColor=color  
}
function lib_writeIt(text,startHTML,endHTML){
	if(bw.ns4){if(!startHTML){startHTML=""; endHTML=""}
	this.ref.open("text/html"); this.ref.write(startHTML+text+endHTML); this.ref.close()
	}else this.evnt.innerHTML=text
}
function lib_clipTo(t,r,b,l,setwidth){ 
	this.ct=t; this.cr=r; this.cb=b; this.cl=l
	if(bw.ns4){this.css.clip.top=t;this.css.clip.right=r; this.css.clip.bottom=b;this.css.clip.left=l
	}else{
		if(t<0)t=0;if(r<0)r=0;if(b<0)b=0;if(b<0)b=0
		this.css.clip="rect("+t+","+r+","+b+","+l+")";
		if(setwidth){
			if(bw.opera){this.css.pixelWidth=r; this.css.pixelHeight=b}
			else{this.css.width=r; this.css.height=b}; this.w=r; this.h=b
		}
	}
}
function lib_clipBy(t,r,b,l,setwidth){this.clipTo(this.ct+t,this.cr+r,this.cb+b,this.cl+l,setwidth)}
function b_clipIt(tstop,rstop,bstop,lstop,step,fn,wh,www){
if(!fn) fn=null; if(!wh) wh=null; var clipval=new Array()
if(bw.dom || bw.ie4) {clipval=this.css.clip; clipval=clipval.slice(5,clipval.length-1);
clipval=clipval.split(' '); for(var m=0;m<4;m++){clipval[m]=parseInt(clipval[m])}
}else{clipval[0]=this.css.clip.top; clipval[1]=this.css.clip.right
clipval[2]=this.css.clip.bottom; clipval[3]=this.css.clip.left}
totantstep=Math.max(Math.max(Math.abs((tstop-clipval[0])/step),Math.abs((rstop-clipval[1])/step)),
Math.max(Math.abs((bstop-clipval[2])/step),Math.abs((lstop-clipval[3])/step)))
if(!this.clipactive)this.clip(clipval[0],clipval[1],clipval[2],clipval[3],(tstop-clipval[0])/totantstep,
(rstop-clipval[1])/totantstep,(bstop-clipval[2])/totantstep,
(lstop-clipval[3])/totantstep,totantstep,0, fn,wh,www)}
function b_clip(tcurr,rcurr,bcurr,lcurr,tperstep,rperstep,bperstep,lperstep,totantstep,antstep,fn,wh,www){
tcurr=tcurr+tperstep; rcurr=rcurr+rperstep; bcurr=bcurr+bperstep; lcurr=lcurr+lperstep
if(www)this.clipTo(tcurr,rcurr,bcurr,lcurr,1);
else this.clipTo(tcurr,rcurr,bcurr,lcurr);
eval(wh); if(antstep<totantstep){this.clipactive=true;	antstep++
setTimeout(this.obj+".clip("+tcurr+","+rcurr+","+bcurr+","+lcurr+","+tperstep+","
+rperstep+","+bperstep+","+lperstep+","+totantstep+","+antstep+",'"+fn+"','"+wh+"','"+www+"')",50)	
}else{this.clipactive=false; eval(fn)}}
function lib_slideIt(endx,endy,inc,speed,fn,wh) {
if (!this.slideactive) {var distx = endx - this.x;var disty = endy - this.y
var num = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2))/inc
var dx = distx/num;var dy = disty/num
this.slideactive = 1; this.slide(dx,dy,endx,endy,speed,fn,wh)}}
function lib_slide(dx,dy,endx,endy,speed,fn,wh) {
if (!fn) fn = null; if(!wh) wh=null
if (this.slideactive && (Math.floor(Math.abs(dx))<Math.floor(Math.abs(endx-this.x)) || Math.floor(Math.abs(dy))<Math.floor(Math.abs(endy-this.y)))) {
this.moveBy(dx,dy); eval(wh)
slidTim=setTimeout(this.obj+".slide("+dx+","+dy+","+endx+","+endy+","+speed+",'"+fn+"','"+wh+"')",speed)
}else{this.slideactive = 0;this.moveIt(endx,endy);eval(fn)}}
function lib_obj(obj,nest,dnest,ddnest,num){
	this.num=num; if(!bw.bw) return lib_message('Old browser')
	if(!bw.ns4) this.evnt=bw.dom && document.getElementById(obj)||bw.ie4 && document.all[obj]
	else{
		if(ddnest){
		this.evnt=document[nest].document[dnest].document[ddnest].document[obj]?document[nest].document[dnest].document[ddnest].document[obj]:0;
		}else if(dnest){this.evnt=document[nest].document[dnest].document[obj]?document[nest].document[dnest].document[obj]:0;
		}else if(nest){this.evnt=document[nest].document[obj]?document[nest].document[obj]:0;
		}else{this.evnt=document.layers[obj]?document.layers[obj]:0;}	
	}
	if(!this.evnt) return lib_message('The layer does not exist ('+obj+') - Exiting script\n\nIf your using Netscape please check the nesting of your tags!')
	this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt;  this.ref=bw.dom||bw.ie4?document:this.css.document;
	this.moveIt=lib_moveIt; this.moveBy=lib_moveBy; this.showIt=lib_showIt; this.hideIt=lib_hideIt;
	this.writeIt=lib_writeIt; this.bg=lib_bg; this.clipTo=lib_clipTo; this.clipBy=lib_clipBy;
	this.slideIt=lib_slideIt; this.slide=lib_slide; this.obj = obj + "Object"; 	eval(this.obj + "=this")
	return this
}

//EX
function setMode(mode){
	l=location.href
	s=location.search
	l=l.replace(s,"")
	if(s.indexOf("?")>-1){
		if(s.indexOf("setMode")>-1){
			s=s.substr(0,s.indexOf("setMode"))
		}
		if(s.lastIndexOf("&")==s.length-1||s.indexOf("?")==s.length-1) se=""
		else if(s.length>1) se="&"
		else se="?"
	}else se="?"
	location.href=l+s+se+"setMode="+mode
}
	var oWin=new Array; oWin.zIndex=10; oWin.dragobj=-1; oWin.resizeobj=-1; oWin.zIndex=100
var isFront;
function winit(w,is,w1,h1,x1,y1){
	wins=w
	win_init()
	winpage=lib_doc_size()
	for(m=0;m<wins;m++){
		create_window(m,0,0,1)
	}
	oWin.currwins=m
	if(is){
		isFront=1
		setWindows()
	}
	if(w1){
		n=0
		for(m=2;m<arguments.length;m+=4){
			oWin[n].resize(arguments[m],arguments[m+1])
			oWin[n].origw=arguments[m]; oWin[0].origh=arguments[m+1]
			oWin[n].moveIt(eval(arguments[m+2]),arguments[m+3])
			oWin[n].showIt()
			n++
		}
	}
}
function create_window(m,link,heading,SYSTEM){
	oWin[m]=new lib_obj('divWin'+m,'','','',m)
	oWin[m].oWindow=new lib_obj('divWindow'+m,'divWin'+m)
	oWin[m].oText=new lib_obj('divWinText'+m,'divWin'+m,'divWindow'+m)
	oWin[m].oButtons=new lib_obj('divWinButtons'+m,'divWin'+m)

	if(!bw.ns4){
		if(!bw.opera5){
			oWin[m].oWindow.css.overflow="hidden"
			oWin[m].css.overflow="hidden"
		}
	}

	if(link){
		//Loader
		if(!bw.ns4) oWin[m].oLoader=new lib_obj('ifrWin'+m,'divWin'+m)
		if(!bw.ns6&&!bw.ns4) oWin[m].oIfr=document.frames['ifrWin'+m]
	}
	
	oWin[m].lastx=oWin[m].x
	oWin[m].lasty=oWin[m].y
	oWin[m].origw=250
	oWin[m].origh=250
	
	//Functions
	oWin[m].minimize=function (a,b){
	    if(this.state!="min"){
		if(this.state!="max"){this.lastx=this.x; this.lasty=this.y}
		x=888;//document.body.clientWidth-100;
		y=113;
		this.slideIt(x,y,1000,1)
		this.state="min"
		this.resize(90,14)
	}else this.regwin()
};

	oWin[m].resize=win_resize;
	oWin[m].close=win_close;
	oWin[m].regwin=win_regwin
	oWin[m].load=win_load;
	oWin[m].addZ=win_addZ;
	oWin[m].state="reg"
	oWin[m].heading=heading?heading:""
	if(link){
		oWin[m].resize(250,250)
		oWin[m].load(link)
		oWin[m].moveIt(20,150)
	}
	if(!SYSTEM){
		oWin[m].showIt()
	}
}
//Window functions 
function win_regwin(){
	this.resize(this.origw,this.origh)
	this.slideIt(this.lastx,this.lasty,30,10)
	this.state="reg"
	if(bw.ns4) this.load(this.url)
	this.addZ()
}
function win_close(){
	this.hideIt()
}
function win_resize(w,h){
	this.oButtons.moveIt(w-28,0)
	this.oWindow.clipTo(0,w-2,h-2,0,1)
	this.clipTo(0,w,h,0,1)
	this.oText.moveIt(2,3)
}

//Loading functions
function win_load(url,heading){
	if(!url) return
	if(!heading) heading=this.heading
	this.heading=heading
	if(bw.ns4){
		url+="?addtop=1"
		this.oText.css.load(url,this.oWindow.cr-4)
	}else{
		this.oLoader.evnt.src=url
	}
	setTimeout("checkloaded("+this.num+")",500)
	this.url=url
	if(bw.opera) return true
	return false
}
function win_addZ(){
	oWin.zIndex++
	this.css.zIndex=oWin.zIndex
}
//Initiating winpage
function win_init(){
	if(document.layers){
		document.captureEvents(Event.MOUSEMOVE | Event.MOUSEDOWN | Event.MOUSEUP | Event.DBLCLICK)
		document.ondblclick=mdblclick;
	}
	document.onmousemove=mmove;
	document.onmousedown=mdown
	document.onmouseup=mup;
}
//Event functions
function w_mmover(num,resize){ //Mouseover on elements
	if(!resize) oWin.dragover=num
	else oWin.resizeover=num
}
function w_mmout(){ //Mouseout on elements
	oWin.dragover=-1
	oWin.resizeover=-1
}
function mup(e){ //Mouseup
	if(oWin.dragobj!=-1){oWin[oWin.dragobj].lastx=oWin[oWin.dragobj].x; oWin[oWin.dragobj].lasty=oWin[oWin.dragobj].y}
	oWin.dragobj=-1	
	if(oWin.resizeobj!=-1){
		oWin[oWin.resizeobj].checkscroll()
		oWin[oWin.resizeobj].origw=oWin[oWin.resizeobj].cr
		oWin[oWin.resizeobj].origh=oWin[oWin.resizeobj].cb
		if(bw.ns4) oWin[oWin.resizeobj].load(oWin[oWin.resizeobj].url)
		
	}else if(bw.ns4) routeEvent(e)		
	oWin.resizeobj=-1
}
function mdown(e){ //Mousedown
	x=(bw.ns4 || bw.ns6)?e.pageX:event.x||event.clientX
    y=(bw.ns4 || bw.ns6)?e.pageY:event.y||event.clientY
	if(bw.ie5 || bw.ie6) y+=document.body.scrollTop
	id1=oWin.dragover
	id2=oWin.resizeover
	if(id1>-1 || id2>-1){
		if(id2>-1){ id=id2; oWin.resizeobj=id;
		}else{ 
			id=id1; oWin.dragobj=id
			oWin.clickedX=x-oWin[id].x; 
			oWin.clickedY=y-oWin[id].y
		}
		oWin[id].addZ()
		//Setting background-colors	
		for(i=0;i<wins;i++){
			if(i!=id1&&i!=id2){
				oWin[i].oWindow.bg("white")
			}else oWin[i].oWindow.bg("#EEF3F9")
		}
	}else if(bw.ns4) routeEvent(e)
}

function mmove(e,y,rresize){ //Mousemove
	x=(bw.ns4 || bw.ns6)?e.pageX:event.x||event.clientX
    y=(bw.ns4 || bw.ns6)?e.pageY:event.y||event.clientY
	if(bw.ie5 || bw.ie6) y+=document.body.scrollTop
	id1=oWin.dragobj
	id2=oWin.resizeobj
	if(id2>-1){ //Resize
		nx=x; ny=y
		oldw=oWin[id2].cr
		oldh=oWin[id2].cb
		cw= nx -oWin[id2].x
		ch= ny - oWin[id2].y
		if(cw<120) cw=120
		if(ch<70) ch=70
		oWin[id2].resize(cw,ch)
	}else if(id1>-1){ //Move
		nx=x-oWin.clickedX; ny=y-oWin.clickedY
		if(ny<140) ny=140
		oWin[id1].moveIt(nx,ny)
		if(oWin[id].state==0){oWin[id].lastx=nx; oWin[id].lasty=ny}
	}
	if(!bw.ns4) return false      
}
function mdblclick(e,num){ //Doubleclick
	if(num>-1) oWin[num].maximize()
	else if(oWin.dragover>-1) oWin[oWin.dragover].maximize()
}
function setWindows(placeit,rez){
	between=10
	oWin.rows=Math.round((oWin.currwins/3)+0.2)
	oWin.columns=1
	n=0;q=0;p=0;
	for(m=0;m<wins;m++){
		if(n==oWin.columns-1){
			oWin.columns=oWin.currwins-q<3?oWin.currwins-q:oWin.currwins-q==4?2:3
			if(oWin.currwins!=1 && q!=0) p++
			n=0
		}else if(q!=0) n++
		oWin[m].origw=(winpage.x2-3-(between*oWin.columns))/oWin.columns 
		oWin[m].origh=(winpage.y2-137-(between*oWin.rows))/oWin.rows
		oWin[m].origx=oWin[m].origw*(n)+(between*n+1) +5
		oWin[m].origy=oWin[m].origh*p+140+(between*p)  + 3
		if(!placeit){oWin[m].lasty=oWin[m].origy; oWin[m].lastx=oWin[m].origx
		}else{
			oWin[m].lasty=((page.avail)*parseFloat(oWin[m].yy)/100)+130 ; 
			oWin[m].lastx=page.x2*parseFloat(oWin[m].xx)/100
		}
		oWin[m].resize(oWin[m].origw,oWin[m].origh)
		st=oWin[m].state;
		oWin[m].regwin()
		if(st==1) oWin[m].minimize(1); else if(st==2) oWin[m].maximize(1)
		else if(st==3) oWin[m].close(); 
		else oWin[m].moveIt(oWin[m].lastx,oWin[m].lasty); if(!placeit)oWin[m].showIt()
		q++;
	}
}