document.phpurl = "news.php"
init()
function init(){

	document.ttl = document.getElementById("sp-ttl")
	var tmp = document.getElementById("dv-brw-tmp")

	//alert(document.yr + '\n' + achrw)
	//alert("init says\n" + n)
	achclk()
	document.sk = Array(document.getElementById("dv-tmpl"), document.getElementById("dv-tmpl"))
	document.lnm = document.getElementById("dvdes")

}

function achclk(){

	
	kzam("getnews", "")
	
	//alert(this.ayr)
}
function adminobjb(n){
	var ky = document.getElementById("spkey");
	if(ky.innerHTML == 'vegetables'){
		tx = prompt("Welcome, Please login below", "")
		kzam("knock", tx )
	}
	else{
		ky.innerHTML = 'vegetables'
		document.admin = 0
		writeCookie("inlvl", "", 1)
	document.newb = document.getElementById("edt-new")
	document.newb.style.display = "none"
		//setedt(false)
	}
}
// what you get from login
function timber(str){
	var ky = document.getElementById("spkey");
	bt = str.split(":O:")
	document.admin = bt[0]
	alert(bt[1])
    if (bt[0] == 0) { return 0; }
	ky.innerHTML = '&nbsp; ~ = Log Out = ~ &nbsp;'
	writeCookie("inlvl", 5, 2)

	document.newb = document.getElementById("edt-new")
	document.newb.style.display = "block"
	document.newb.onclick = function (){
		kzam("nwnws", 0)
	}

}
function gotnews(str, msg){
	if(msg){alert(msg)}
	//alert(str)
	datry = str.indexOf(":R:") > -1 ? str.split(":R:") : Array(str)

	if(!document.clns){
		document.clns = Array()
	}
	//alert("got prop datry length\n" + datry.length)
	for(var i=0;i<datry.length;i++){
		//
		if(!document.clns[i]){
			document.skin = document.sk[i%2]
			document.clns[i] = mkcln(datry[i])
			document.clns[i].dad = document.clns
			document.clns[i].rwfmt = "bluebody"
		}
		document.clns[i].setv(datry[i])
	}	
	for(;i < document.clns.length; i++){
		document.clns[i].style.display =  "none"
	}

lvl = readCookie("inlvl")
 if(lvl == 5){
  var ky = document.getElementById("spkey");
  ky.innerHTML = '&nbsp; ~ = Log Out = ~ &nbsp;'
  document.newb = document.getElementById("edt-new")
  document.newb.style.display = "block"
  document.newb.onclick = function (){
   kzam("nwnws", 0)
  }
 }

}

function popme(ths){
		// alert(ths.dad.dad.rwdat+"kk");
	document.nwsidb = ths.dad.dad.rwdat.replace(/^.+?_id:V:(\d+):F:.+$/, "$1")
	//alert(document.nwsidb);
	writeCookie("rdat", document.nwsidb, 2)
		//alert(readCookie("rdat"))

	window.open("nws.html?"+document.nwsidb, "mypop",'toolbar,width=600,height=400,scrollbars=yes')
	//window.open("nws.html?"+document.nwsidb, "mypop")
}
function pgspc(fo){
	if(fo.fld.indexOf("dte") > 0){
		fo.onsetv = "donwdte(this.htm)"
	}
}
function donwdte(dtdv){
	mry = Array("", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
	str = dtdv.innerHTML
	if(str.indexOf("-") > 0){
		dtdv.val = str
		m = str.match(/(\d{4})-(\d{2})-(\d{2})/)
		dtdv.innerHTML = mry[1*m[2]] + ' ' + m[1]
	}
}

function nwok(msg){
	alert(msg)
	window.location = window.location
}

