var P="admin"
var FF=!document.all
var Wo,sy=0,sx=0,ty,tx,x=0,y=0,ok,wh,ww
Wi=0
Wz=0
Wn=1

var CONTENT=new Array()

function WS(wf,wb,fs)
{
	document.getElementsByTagName('BODY')[0].onmousemove=function(){Wn=1}
	WW()
	W("Login","/shared/login.php",280,280,0,0,1)
	W("Welcome","/shared/welcome.php",320,280,y-20,x-290,2)
	WN(0,"About","/W/F/about.png","/shared/about/about.php",0,560)
	y=0
	var a="<script src=/shared/V.js></script>"
	a+="<iframe id=SAVE></iframe>"
	document.write(a)
}

function WN(p,n,i,s,h,w,t,l,b,m)
{
	s=(s.substr(s.length-1)=="#"?s.substr(0,s.length-1):s)
	var a=document.createElement("A")
	a.href="javascript:void(W('"+n+"','"+s+"',"+(h?h:0)+","+(w?w:0)+","+(t?t:0)+","+(l?l:0)+","+(b?b:0)+"))"
	a.onfocus=function(){this.blur()}
	a.innerHTML="<center><img src="+i+"><b>"+n+"</b><center>"
	v=document.getElementById("Wn").getElementsByTagName("TH")[0]
	if(p)
		v.insertBefore(a,v.getElementsByTagName("A")[p-1])
	else
		v.appendChild(a)
}

function WC(n)
{
	a=document.getElementsByTagName("TH")
	for(var i=0;i<a.length;i++)
	{
		if(a[i].className=="Wcm")
		{
			v=a[i].getElementsByTagName("B")[0].innerHTML
			if(n==v)
			{
				ww=0
				WMN(a[i].lang,1)
				WU(a[i].lang)
				break
			}
		}
	}
}

function W(n,s,h,w,t,l,bb)
{
	n=n.replace(/_/g," ")
	if(n!="Gallery Upload"&&n!="Edit Pages")
		WC(n)
	if(ww)
	{
		s=(s.substr(s.length-1)=="#"?s.substr(0,s.length-1):s)
		WW()
		var a=document.createElement('TABLE')
		a.id="W_"+Wi
		a.className="Wt"
		a.style.zIndex=Wz+2
		 var k=new Date().getSeconds()/2
		h=(h?(h>wh-99?wh-99:h):480)+20
		w=(w?(w>ww-40?ww-40:w):480)+20
		y=(t?(t+h>wh-99?40:t):wh/2-(h/2))-k
		x=(l?(l+w>ww-40?40:l):ww/2-(w/2))-k
		a.style.top=y
		a.style.left=(x<20?20:x)
		a.style.height=h
		a.style.width=w
		a.onmousedown=function(){""+Wi+""}

		var b=document.createElement('TBODY')
		var c=document.createElement('TR')

		var d=document.createElement('TD')
		d.style.width=8
		d.style.height=8
		d.innerHTML="<img src=/W/S1.png height=8 width=8>"
		c.appendChild(d)

		d=document.createElement('TD')
		d.style.background="url(/W/S2.png) repeat-x bottom left"
		c.appendChild(d)

		d=document.createElement('TD')
		d.style.width=16
		d.style.height=8
		d.innerHTML="<img src=/W/S3.png height=8 width=16>"
		c.appendChild(d)
		b.appendChild(c)
		
		c=document.createElement('TR')
		d=document.createElement('TD')
		d.style.background="url(/W/S8.png) repeat-y top right"
		c.appendChild(d)

		d=document.createElement('TD')

		var e="<table class=Wif	 onclick=WU("+Wi+")>"
		e+="<tr>"
		e+="<th colspan=3 lang="+Wi+" class=Wcm ondblclick=WMN("+Wi+")>"
		if(bb!=1)
			e+="<a href=javascript:void(WD("+Wi+")) onfocus=blur() onmouseover=\"T_S(event,'Close',1)\">&#215;</a>"
		e+="<a href=javascript:void(0) onclick=WMN("+Wi+") onfocus=blur() style=font-size:18px;line-height:17pt onmouseover=\"T_S(event,'Minimize',1)\">&#9660;</a>"
		if(bb==2)
			e+="<a href=javascript:void(WF("+Wi+")) onfocus=blur() onmouseover=\"T_S(event,'Maximize',1)\" style=font-size:18px;line-height:17pt;letter-spacing:-4>&#9650;</a>"
		e+="<b lang="+Wi+" class=Wtt>"+n+"</b>"
		e+="</th>"
		e+="</tr>"
		e+="<tr>"
		e+="<td class=Wcw lang="+Wi+"></td>"
		e+="<td class=Wi>"
		e+="<iframe src="+s+(s.indexOf(".php?")>0?"&":"?")+"W="+Wi+" id=iF_"+Wi+" marginwidth=0 marginheight=0 frameborder=0></iframe>"
		e+="</td>"
		e+="<td class=Wce lang="+Wi+"></td>"
		e+="</tr>"
		e+="<tr>"
		e+="<td class=Wcne lang="+Wi+"></td>"
		e+="<td class=Wcs lang="+Wi+"></td>"
		e+="<td class=Wcnw lang="+Wi+"></td>"
		e+="</tr>"
		e+="</table>"

		d.innerHTML=e
		c.appendChild(d)

		d=document.createElement('TD')
		d.style.background="url(/W/S4.png) repeat-y top left"
		c.appendChild(d)
		b.appendChild(c)
		
		c=document.createElement('TR')
		d=document.createElement('TD')
		d.style.width=8
		d.style.height=16
		d.innerHTML="<img src=/W/S7.png height=16 width=8>"
		c.appendChild(d)

		d=document.createElement('TD')
		d.style.background="url(/W/S6.png) repeat-x top left"
		c.appendChild(d)

		d=document.createElement('TD')
		d.style.width=16
		d.style.height=16
		d.innerHTML="<img src=/W/S5.png height=16 width=16>"
		c.appendChild(d)

		b.appendChild(c)
		a.appendChild(b)
		document.getElementsByTagName('body')[0].appendChild(a)
		
		Wz++
		Wi++
	}
	else
		WW()
}

document.onmousedown=function(e) 
{
	Wo=FF?e.target:event.srcElement
	sy=FF?window.scrollY:document.body.scrollTop
	sx=FF?window.scrollX:document.body.scrollLeft
	y=FF?e.clientY:event.clientY
	x=FF?e.clientX:event.clientX
	if(Wo.lang)
	{
		ok=(Wo.className=='Wce'?4:Wo.className=='Wcnw'?5:Wo.className=='Wcs'?6:Wo.className=='Wcne'?7:Wo.className=='Wcw'?8:1)
		Wo=document.getElementById("W_"+Wo.lang)
		ty=parseInt(Wo.style.top)
		tx=parseInt(Wo.style.left)
		oh=parseInt(Wo.style.height)
		ow=parseInt(Wo.style.width)
		document.onmousemove=WM
	}
}

function WM(e)
{
	if(ok>0)
	{
		var e_y=(FF?e.clientY:event.clientY)-y
		var e_x=(FF?e.clientX:event.clientX)-x
		if(ok==5||ok==6||ok==7)
			Wo.style.height=oh+e_y
		if(ok==4||ok==5)
			Wo.style.width=ow+e_x
		else if(ok==8||ok==7)
			Wo.style.width=ow+(tx-(tx+e_x))
		else if(ok==1)
			Wo.style.top=ty+e_y
		if(ok==1||ok==7||ok==8)
			Wo.style.left=tx+e_x
	}
	return false
}

document.onmouseup=function()
{
	WMX()
}

function WMX()
{
	ok=0
}

window.onresize=function()
{
	WW()
	document.getElementById("Wm").style.top=wh-24
}

function WD(t)
{
	var m=document.getElementById("Wm")
	var n=document.getElementById("WM_"+t)
	if(n)m.removeChild(n)
	var w=document.getElementById("W_"+t)
	document.getElementsByTagName("BODY")[0].removeChild(w)
	var a=document.getElementsByTagName("TABLE")
	var i=0
	while(a[i])
	{
		var f=a[i].getElementsByTagName("IFRAME")[0]
		if(a[i].className=="Wt"&&(f.contentWindow.WZ==t||f.contentWindow.WR==t))
		{
			n=document.getElementById("WM_"+a[i].id.substr(2))
			if(n)m.removeChild(n)
			document.getElementsByTagName("BODY")[0].removeChild(a[i])
		}
		i++
	}
	if(window.T_O1)T_F(100)
}

function WMN(w,f)
{
	var m=document.getElementById("Wm")
	m.style.top=wh-24
	var a=document.getElementById("W_"+w)
	if(f||a.style.display=="none")
	{
		var b=document.getElementById("WM_"+w)
		if(b)
			m.removeChild(b)
		Wz=Wz+2
		a.style.zIndex=Wz
		a.style.display=""
		w=document.getElementById("iF_"+w).contentWindow
		w.scrollTo(w.sy,w.sy)
	}
	else
	{
		a.style.display="none"
		v=a.getElementsByTagName("TH")[0].getElementsByTagName("B")[0].innerHTML
		a=document.createElement("A")
		a.onfocus=function(){this.blur()}
		a.className="Wmn"
		a.innerHTML=v
		a.id="WM_"+w
		a.href="javascript:void(WMN("+w+"))"
		m.appendChild(a)
	}
}

function WU(w)
{
	w=document.getElementById("W_"+w)
	Wz++
	w.style.zIndex=Wz
}

function WW()
{
	sy=FF?window.scrollY:document.body.scrollTop
	sx=FF?window.scrollX:document.body.scrollLeft
	wh=(FF?window.innerHeight:document.body.clientHeight)
	ww=(FF?window.innerWidth:document.body.clientWidth)
	if(!FF)
	{
		t=document.getElementById("Wb")
		if(t)
		{
			t.style.height=wh
			t.style.width=ww
		}
		t=document.getElementById("Wv")
		if(t)
		{
			t.style.height=wh
			t.style.width=ww+20
		}
	}
}

function WR(w,a)
{
	if(w)
	{
		var w=document.getElementById("iF_"+w)
		if(w)
		{
			var v=""+w.contentWindow.location
			w.src=(v.substr(v.length-1)=="#"?v.substr(0,v.length-1):v)
		}
	}
	else
	{
		var f=document.getElementsByTagName("IFRAME")
		var i=1
		while(f[i])
		{
			if(f[i].contentWindow.location.href.indexOf(a)>-1)
			{
				var v=""+f[i].contentWindow.location.href
				f[i].src=(v.substr(v.length-1)=="#"?v.substr(0,v.length-1):v)
				break
			}
			i++
		}
	}
}

function WgW(v)
{
	var f=document.getElementsByTagName("IFRAME")
	var i=0
	while(f[i])
	{
		if(f[i].contentWindow.location.href==v)
		{
			return f[i].id.substr(3)
			break
		}
		i++
	}
}

function WF(w)
{
	var a=document.getElementById("W_"+w)
	var qt=0,ql=0,qh=wh,qw=ww
	if(a.lang)
	{
		var v=a.lang.split("|")
		qt=v[0];ql=v[1];qh=v[2];qw=v[3]
		a.lang=""
	}
	else
		a.lang=parseInt(a.style.top)+"|"+parseInt(a.style.left)+"|"+parseInt(a.style.height)+"|"+parseInt(a.style.width)
	a.style.top=qt
	a.style.left=ql
	a.style.height=qh
	a.style.width=qw
}

function Wn0(v)
{
	Wz++
	document.getElementById('WnB').style.zIndex=(v?Wz:0)
	document.getElementById('WnB').className=(v?'':'i')
	document.getElementById('Wn').style.zIndex=(v?Wz:0)
}

function WNC(w,n)
{
	w=document.getElementById("W_"+w).getElementsByTagName("B")[0].innerHTML=n.replace(/_/g," ")
}