function openWin(imgName, tElement, W, H){
W += 20;
H += 20;
hOffset = (screen.availWidth-W)/2
params='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=20, width='+W+',height='+H+', left='+hOffset ;
imgBox = window.open ("","imgWindow",params) ;
imgBox.document.write ("<HTML><HEAD><TITLE>"+tElement+"</TITLE><link rel='stylesheet' href='vrstyle.css' type='text/css'</HEAD><BODY onBlur='self.close()'>") ;
imgBox.document.write ("<CENTER><a href = 'javascript:self.close()'><img src="+imgName+" border='0'/></a>") ;
imgBox.document.write ("</CENTER></BODY></HTML>") ;
}

function getPHPDir(){
return "www.untitledstates.net/phpstuff/";
}

function openSW(tUrl){
params='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=660,height=520' ;
//swBox = window.open(tUrl);
swBox = window.open(tUrl, "", params);
}

function openText(tUrl){
hOffset = (screen.availWidth-500)/2
params='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=400, top=50, left='+hOffset ;
textBox = window.open ("press/"+tUrl,"textWindow",params);
//alert(textBox.document.body.onblur);
//textBox.document.body.onblur = 'self.close()'
}

function doStatus(tElement){
window.status = tElement;
//this.onmouseout = clearStatus();
return true;
}


// experimental
function doLinks(tDoc){
for (i =0; i< document.anchors.length; i++){
//alert (document.anchors[i].innerHTML);
tAnchor = eval(document.anchors[i]);
alert (tAnchor);
document.anchors[i].onmouseover = function(){doStatus("arse"+tAnchor)};
//alert (document.anchors[i].onclick);
}
}

function doLink(){
elNum = document.anchors.length-1
thisElement = document.anchors(elNum);
alert (thisElement.id);
IDID = thisElement.id;
thisElement.onmouseover = function(){alert(document.anchors(elNum).id)};
}

function validate(thisForm){

if (thisForm.messageName.value == ""){
alert ("Please enter your name.");
return;
}

if (thisForm.messageText.value == ""){
alert ("Please enter your message.");
return;
}
thisForm.messageDate.value = doDate(thisForm);
thisForm.submit();
}

function doDate(thisForm){
toDay = new Date();
dateString = (toDay.getDate())+" / "+(toDay.getMonth()+1)+" / "+(toDay.getFullYear());
return dateString;
}

function validate2(thisForm){
if (thisForm.messageText.value == ""){
alert ("Text is blank!");
return;
}
thisForm.messageDate.value = doDate(thisForm);
//thisForm.messageText.value = doApostrophes(thisForm.messageText.value);
thisForm.submit();
}

function validate3(thisForm){
if (thisForm.messageText.value == ""){
alert ("Text is blank!");
return;
}
thisForm.submit();
}

function backToEntry(){
//location.href = "http://www.venusray.com/newsupdate.php?passwordCheck=1";
history.back();
	//messageForm.messageText=msgText;
}

function doApostrophes(tText){
	// sort Apostrophes
	var result = "";
	for (var i = 0; i < tText.length; i++){
		if(tText.charAt(i) =="\'"){
			result = result.concat("`");
		} else if (tText.charCodeAt(i) ==13){
			result = result.concat("<br>");
		}else{
			result = result.concat(tText.charAt(i));
			//result = result.concat(tText.charAt(i));
		}
	}
	return result;
}

function stripSlashes(tText){
	// get rid of backslashes
	var result = "";
	for (var i = 0; i < tText.length; i++){
		if(tText.charAt(i) !="\\"){
			result = result.concat(tText.charAt(i));
		}
	}
	return result;
}