<!-- Hide from old browsers
// JavaScript Document

//print this page
function printIt(){
	window.print();
	}
	
//pop ups. lots of pop ups.
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=440,left = 200,top = 200');");
}

function popUpSmall(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=480,height=640,left = 250,top = 250');");
}


function PopupSmallWindow(url, name) {
 newwindow = window.open(url, name,"menubar=yes,toolbar=yes,titlebar=yes,location=yes,scrollbars=yes,resizable=yes,status=yes,width=300,height=300");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//General form functions
//function load(formName) {
//  var list = document[formName].list;
//  var str = list.options[list.selectedIndex].value;
//  if (str != "") location.href = str;
//}


function textClear (input) {
	if ( input.value == input.defaultValue ) {input.value = "";}
}

function textRestore (input) {
	if ( input.value == "" ) {input.value = input.defaultValue;}
}


//Calendar javascript
function SubmitDate() {
	if (document.DateForm.timebase.value != "") {
	document.DateForm.submit();
	}
}
function SubmitCity() {
	if (document.CityForm.city.value != "") {
	document.CityForm.submit();
	}
}
function SubmitType() {
	if (document.TypeForm.whatTypeID.value != "") {
	document.TypeForm.submit();
	}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MurderMap1() {
	newwindow = window.open("/news/murdermap.asp?year=2006","email_popup","toolbar=no,scrollbars=no,resizable=yes,status=yes,width=800,height=800");
}

function MurderMap2() {
	newwindow = window.open("/news/murdermap.asp?year=2007","email_popup","toolbar=no,scrollbars=no,resizable=yes,status=yes,width=800,height=800");
}


function getCookie(Name){ 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}

function setCookie(name, value){
document.cookie = name+"="+value //cookie value is domain wide (path=/)
}


/// for the blurb guide
var xmlHttp
var imagename
var ape

function ajax_GET(){ 
	clear_Thangs(document.getElementById("container_fff"), "div", "blurb_show")
	ape = this.firstChild;
	this.style.color="#627";
	var title = this.firstChild.nextSibling.nodeValue; 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
		}
	var url=document.getElementById('ajax_url').value
	url=url+"?q="+title
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=make_New; 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	//give image a name in global variable
	imagename = title.replace(/[^a-z0-9\-_]/gi,'')
	}


function GetXmlHttpObject()
 { 
 var objXMLHttp=null
 if (window.XMLHttpRequest)
  {
  objXMLHttp=new XMLHttpRequest()
  }
 else if (window.ActiveXObject)
  {
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
 return objXMLHttp
}

function make_New() { 


if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
	 xmlDoc=xmlHttp.responseXML;
	 
	 var a = document.createTextNode(xmlDoc.getElementsByTagName("filmtitle")[0].childNodes[0].nodeValue);
	 var b = document.createTextNode(xmlDoc.getElementsByTagName("director")[0].childNodes[0].nodeValue);
	 var c = document.createTextNode(xmlDoc.getElementsByTagName("date")[0].childNodes[0].nodeValue);
	// var d = document.createTextNode(xmlDoc.getElementsByTagName("body")[0].childNodes[0].nodeValue);
	var d = new Array
	for (var i =0;i<xmlDoc.getElementsByTagName("body").length;i++){
		d[i]= document.createTextNode(xmlDoc.getElementsByTagName("body")[i].childNodes[0].nodeValue)
		}
	
	var m=document.createElement('img');

	
	var e = document.getElementById('sb_id').value
	m.src='../sb/'+e+'/images/'+imagename+'.jpg';
	m.style.display='none';
	m.onload=function(){
		m.style.border='solid 1px #888';
		m.style.display='block';
		m.style.margin='10px 0px 10px 0px';
	}
	ape.appendChild(m)

	
	ape.appendChild(document.createElement('br'));
	ape.appendChild(a);
	ape.appendChild(document.createElement('br'));
	ape.appendChild(b);
	ape.appendChild(document.createElement('br'));
	ape.appendChild(c);
	ape.appendChild(document.createElement('br'));
	for(var i=0;i<d.length;i++){
		ape.appendChild(document.createElement('br'));
		ape.appendChild(d[i]);
		}
	
	
	
	show_ape();

	}
} 



	function make_Thangs(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	strClassName = strClassName.replace(/-/g, "\-");
	var oRegExp = new RegExp("(^|\s)" + strClassName + "(\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className)){
			oElement.onclick = ajax_GET;
		}
	}

}
	function clear_Thangs(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	strClassName = strClassName.replace(/-/g, "\-");
	var oRegExp = new RegExp("(^|\s)" + strClassName + "(\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className)){
			while (oElement.firstChild) 
				 {
					//The list is LIVE so it will re-index each call
					oElement.removeChild(oElement.firstChild);
				 };
				 oElement.style.display = 'none'
		}
	}

}


function empty_ape() {


	// remove all from ape
	while (ape.firstChild) 
	 {
		//The list is LIVE so it will re-index each call
		ape.removeChild(ape.firstChild);
	 };
if (ape.style.display != 'none'){
ape.style.display = 'block';
} else {
ape.style.display = 'none'
}
}


function show_ape() {
	if (ape.style.display != 'block') {
	ape.style.display = 'block';
	
	}

}


//-->