function winStatus(msg)  {
	self.status = msg
	return true
}

winStatus('');

var d=document;
var DirLocation = (GetDirLvls());

// figures out where we are so we can set image paths to our relative location within the site directory structure...
function GetDirLvls(){
	var rtnValue = ""
	sTmp = (location.href.substring(0, location.href.lastIndexOf("/")).toLowerCase())
	sTmp = sTmp.replace("http://flaserver/newstoris.com/", "")
	sTmp = sTmp.replace("http://flaserver/newstoris.com", "")
	sTmp = sTmp.replace("http://flaserver/storis.com/", "")
	sTmp = sTmp.replace("http://flaserver/storis.com", "")
	sTmp = sTmp.replace("http://localhost/", "")
	sTmp = sTmp.replace("http://localhost", "")
	if (sTmp != ""){
		arrTmp = sTmp.split("/")
		for(var i = 0;i < (arrTmp.length);i++){
			if(i > 0){
				rtnValue = rtnValue + "../"
			}
		}
	}
	return rtnValue
}



// function used to open a new child window
var SelectionWindow = null;
function openWindow(url, width, height) {
	var winWidth = (width);
	var winHieght = (height);
	var winl = (screen.width - winWidth) / 2;
	var wint = (screen.height - winHieght) / 2;
    winStats='toolbar=no,location=no,directories=no,menubar=no,'
    winStats+='scrollbars=yes,width='+winWidth+',height='+winHieght
		if (navigator.appName.indexOf("Microsoft")>=0) {
          	winStats+=',left='+winl+',top='+wint
 		}else{
       		winStats+=',screenX='+winl+',screenY='+wint
		}
		
		if (!SelectionWindow || SelectionWindow.closed){
			SelectionWindow = window.open(url,"",winStats);
		}else{
			SelectionWindow.focus();
		}

		if (SelectionWindow.opener == null){
			SelectionWindow.opener = self
		} 
		
    }
	
// used for expandable windows...
var xyPositions = "";
var x = 0;
var y = 0;
var d = document
var ie = d.all
var ns6 = d.getElementById&&!d.all
var id = "hoverInfo"
function expandDiv(element, divWidth, divHeight){
	xyPositions = String(findPos(element));
	var objInfoBox = d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var noPx = document.childNodes ? 'px' : 0;
	if (xyPositions != ""){
		arrTmp = xyPositions.split("|", 2)
		x = (arrTmp[0]);
		y = (arrTmp[1]);
		
		// value is half for morzilla browsers to get positioning right...
		var rePosition = (ns6)?(divWidth / 2): divWidth;
		objInfoBox.style.width = divWidth + noPx;
		//objInfoBox.style.height = divHeight + noPx;
		objInfoBox.style.left = (x - (rePosition + 8)) + noPx;
		objInfoBox.style.top = (y) + noPx;
		objInfoBox.style.display="block";
	}	
}


function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft + "|" + curtop];
}

// used to fill expandable window...
function ajaxFunction(pageName, ElementName){
	var xmlHttp;
  	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}catch (e){// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e){
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
    
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
       		document.getElementById(ElementName).innerHTML=xmlHttp.responseText;
	 	}
	}
	xmlHttp.open("GET",pageName,true);
    xmlHttp.send(null);
}

function HideNode(objNode){
	objNode.style.display="none";
}