function abort(){
	return false;
}
function trim(s) {
    return s.replace(/^\s+/, '').replace(/\s+$/, '');
}
function getHttpRequest(file){
if(window.XMLHttpRequest) // FIREFOX
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // IE
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else
return(false);
xhr_object.open("GET", file, false);
xhr_object.send(null);
if(xhr_object.readyState == 4) return(xhr_object.responseText);
else return(false);
}

function setSpellValue(obj){
	tmpSpell.innerText = obj.innerText;
	tmpSpell.style.backgroundColor = "#D8F8BD";
	oPopup.hide();
}
var tmpSpell;
function getObject(obj,typ,fil,dyn,flt,root){
	val_obj = obj.parentElement.parentElement.cells[3].firstChild;
	txt_obj = obj.parentElement.parentElement.cells[0].firstChild;
	returnValue = openDialogWindow("browser.cfm?VALUE=" + val_obj.value + "&TYPE=" + typ + "&FILES=" + fil + "&DYN=" + dyn + "&FILTER=" + flt + "&ROOT=" + root,document.metaForm,250*(1+fil),350,0,0);
	if(returnValue){
		val_obj.value = returnValue.VAL;
		txt_obj.value = returnValue.LAB;
		openerFx(val_obj,txt_obj);
	}
}
function openerFx(v,t){
	return true;
}
function clearObject(obj,def,lab){
	obj.parentElement.parentElement.cells[3].firstChild.value = def;
	obj.parentElement.parentElement.cells[0].firstChild.value = lab;
	openerFx(obj.parentElement.parentElement.cells[3].firstChild,obj.parentElement.parentElement.cells[0].firstChild);
}
function reloadFrame(fr){
	try{
		win = eval("window.parent." + fr);
		win.location = win.location
	}
	catch(e){}
}
function startSession(proj){
	w = screen.availWidth - 100;
	h = screen.availHeight - 75;
	myWin = openWindow("index.cfm?MODE=0",w,h,proj,0,1);
	myWin.moveTo(50,37);
}
function errorMsg(msg){
	alert(msg);
}
function openDialogWindow(url,param,w,h,r,s){
	returnValue = window.showModalDialog(url,param,"dialogWidth:" + w + "px;dialogHeight:" + h + "px;edge:Raised;center:Yes;help:0;resizable:" + r + ";status:" + s + ";");
	return returnValue;
}
function openModeLessDialogWindow(url,param,w,h){
	returnValue = window.showModelessDialog(url,param,"dialogWidth:" + w + "px;dialogHeight:" + h + "px;edge:Raised;center:Yes;help:0;resizable:0;status:0;");
	return returnValue;
}
function replaceInStringWith(str,substr1,substr2){
	while (str.indexOf(substr1) != -1){
		str = str.replace(substr1,substr2);
	}
	return str;
}
var AnString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
var AllString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
var Integers = "1234567890";

function formatString(inputString,charRange,defValue,replaceString,firstChar){
	st = 0;
	if(firstChar.length > 0){
		tmp = inputString.substr(0,firstChar.length);
		if(tmp == firstChar){
			st = firstChar.length;
		}
	}
	for(i=st;i<inputString.length;i++){
		tmp = inputString.substr(i,1);
		if(charRange.indexOf(tmp) == -1){
			inputString = inputString.replace(tmp,replaceString);
			i = i - (replaceString.length+1);
		}
	}
	if(inputString.length == 0) inputString = defValue;
	return inputString;
}
function URLEncodedFormat(lnk){
	while (lnk.indexOf("=") != -1){
		lnk = lnk.replace("=","%3D");
	}
	while (lnk.indexOf("?") != -1){
		lnk = lnk.replace("?","%3F");
	}
	while (lnk.indexOf("&") != -1){
		lnk = lnk.replace("&","%26");
	}
	return lnk;
}
function openWindow(url,wid,hei,nam,scr,res){
	FixedWindow = window.open(url,"" + nam + "","scrollbars=" + scr + ",toolbar=0,location=0,directories=0,statusbar=0,menubar=0,resizable=" + res + ",width=" + wid + ",height=" + hei + "");	
	return FixedWindow;
}
function ShowHide(obj,i){
	if(i) obj.document.body.cols="65%,35%";
	else obj.document.body.cols="*,0";
}
function cancelEvent(){
   window.event.returnValue = false;
}
function checkWindow(){
	if(top.name.length == 0){
		top.location = "index.cfm";
	}
}
function handleDragStart(curID) {
	window.parent.parent.titleFrame.dragged = curID;
}
function handleDragEnd(){
	window.parent.parent.titleFrame.dragged = null;
}
var tmpID = -1;
function handleDragOver(curID){
	x = window.parent.parent.titleFrame.dragged;
	if(x && x != curID){
		cancelEvent();
		document.all["lab_" + curID].className = "panel_text_selected";
		tmpID = curID;
	}
}
function handleDragLeave(curID){
	tmp = document.all["lab_" + curID];
	tmp.className = tmp.defaultClass;
	tmpID = -1;
	cancelEvent();
}
function handleDrop(curID) {
	tmpIDs = window.parent.parent.titleFrame.dragged;
	tmpIDs = deleteFromList(tmpIDs,curID);
	if(tmpIDs.length > 0){
		window.location = url + "&MOVE=" + tmpIDs + "&TO=" + curID;
	}
}
function deleteFromList(myList,delID){
	inputArray = myList.split(',');
	outputArray = new Array();
	j=0;
	for(i=0;i<inputArray.length;i++){
		if(inputArray[i] != delID){
			outputArray[j] = inputArray[i];
			j++;
		}
	}
	return outputArray;
}
function checkChange(myForm,myID){
	obj = myForm["SHORT"];
	if (obj.value != obj.defaultValue){
		myForm.submit();
	}
	else {
		document.all['lab_' + myID].style.display = 'inline';
		document.all['SHORT_' + myID].style.display = 'none';
	}
}
function returnURL(myURL,mySTR){
	strArray = mySTR.split(',');
	tmpURL = myURL.toString();
	x = tmpURL.indexOf('?');
	if(x > 0){
		defURL = tmpURL.substring(0,x);
		locURL = tmpURL.substring(x+1).split('&');
		for(var i=0;i<locURL.length;i++){
			tmp = true;
			for(var j=0;j<strArray.length;j++){
				tmpLOC = locURL[i].substring(0,locURL[i].indexOf('='));
				if(tmpLOC == strArray[j]){
					tmp = false;
				}
			}
			if (tmp){
				if (defURL.indexOf('?') == -1) defURL += "?" + locURL[i];
				else defURL += "&" + locURL[i];
			}
		}
	}
	else defURL = tmpURL + "?x=0"
	return defURL;
}
function getValueInString(url,item){
	if (url.indexOf(item) != -1){
		x = url.substring(url.indexOf(item));
		y = x.substring(x.indexOf("="));
		z = y.indexOf("&");
		if(z == -1) val =  y.substring(1);
		else val = y.substring(1,z);
	}
	else val = 0;
	return val;
}
var loop;
var speed = 100;
var tgtBox;
var stepL,maxL,minL = 0;
function set(i){
	tgtBox = event.srcElement.parentElement.previousSibling.firstChild;
	stepL = i;
	maxL = eval(tgtBox.MAX*1);
	minL = eval(tgtBox.MIN*1);
	slideLoop();
}
function slideLoop(){
	tgtBox.value = (1*tgtBox.value) + stepL;
	if ((maxL || maxL == 0) && tgtBox.value > maxL){
		tgtBox.value = maxL;
		clearTimeout(loop);
		return false;
	}
	else if ((minL || minL == 0) && tgtBox.value < minL){
		tgtBox.value = minL;
		clearTimeout(loop);
		return false;
	}
	if (speed > 1) speed-=1;
	loop = setTimeout("slideLoop()",speed);
}
function clearLoop(obj,func){
	obj.blur();
	try{
		eval(func);
	}
	catch(e){}
	speed = 100;
	clearTimeout(loop);
}
function setObjectFocus(){
	try{
		event.srcElement.className = 'panel_text_selected';
	}
	catch(e){
		alert(e);
	}
}
function setFocusOnRow(){
	try{
		tmp = event.srcElement;
		while(tmp.id.length == 0){
			tmp = tmp.parentElement;
		}
		for (i=0;i<tmp.all.length;i++){
			tmp.all(i).className = 'panel_text_selected';
		}
		tmp.focus();
	}
	catch(e){
		alert(e);
	}
}
function setBlurOnRow(){
	try{
		tmp = event.srcElement;
		while(tmp.id.length == 0){
			tmp = tmp.parentElement;
		}
		for (i=0;i<tmp.all.length;i++){
			tmp.all(i).className = 'panel_text';
		}
	}
	catch(e){
		alert(e);
	}
}
function setObjectBlur(){
	event.srcElement.className = 'panel_text';
}
function deleteObject(){
	if(event.keyCode == 46){
		if(confirm('Delete ?')){
			tmpRow = document.all[event.srcElement.rowID];
			tmpRow.parentElement.deleteRow(tmpRow.rowIndex);
		}
	}
}
function deleteSelect(obj){
	len = obj.options.length;
	for(i=0;i<len;i++){
		removeItemFromList(obj,0);
	}
}
function populateListWith(obj,valArray,txtArray){
	for(i=0;i<valArray.length;i++){
		tmp = document.createElement("OPTION");
		obj.options.add(tmp);
		tmp.innerText = txtArray[i];
		tmp.value = valArray[i];
	}
	obj.selectedIndex = 0;
}
function addToList(obj,val,txt){
	var tmp = document.createElement("OPTION");
	obj.options.add(tmp);
	tmp.text = txt;
	tmp.value = val;
	return tmp;
}
function checkDeleteKey(){
	if(window.event.keyCode == 46){
		return true;
	}
	else return false;
}
function deleteSelectedFromList(obj){
	sel = obj.selectedIndex;
	removeItemFromList(obj,sel);
	try{
		obj.options[Math.min(sel,obj.options.length-1)].selected = true;
	}
	catch(e){}
}
function deleteSelectedFromSimpleList(obj){
	for(i=0;i<obj.options.length;i++){
		if(obj.options[i].selected){
			removeItemFromList(obj,i);
			sel = i;
		}
	}
	try{
		obj.options[Math.min(sel,obj.options.length-1)].selected = true;
	}
	catch(e){}
}
function removeItemFromList(obj,i){
	obj.remove(i);
}
function deleteRowsFromTable(obj){
	len = obj.rows.length;
	for(i=0;i<len;i++){
		obj.deleteRow(0);
	}
}
function unSelectAll(){
	for (i=0;i<document.all.length;i++){
		if(document.all(i).unselectable != "off"){
			document.all(i).unselectable = "on";
		}
	}
}
function blurFolder(myID){
	try{
		document['fol_' + myID].src = "/gifs/folder_0.gif";
		document.all['lab_' + myID].className = 'panel_text';
	}
	catch(e){}
}
function focusFolder(myID){
	try{
		document['fol_' + myID].src = "/gifs/folder_1.gif";
		document.all['lab_' + myID].className = 'panel_text_selected';
	}
	catch(e){}
}
var logs = "";
function waitTillLoaded(fr){
	var win = eval(fr);
	if(win.document.readyState != "complete"){
		logs = logs + "loading " + win.name + "\n";
		setTimeout("waitTillLoaded(" + fr + ")",1000);
	}
}
function stripHTML(inputString) {
	var outputString = inputString;
	while(outputString.indexOf("<") != -1){
		posDeb = outputString.indexOf("<");
		posEnd = outputString.indexOf(">");
		tmpString = "";
		for(i=posDeb;i<=posEnd;i++){
			tmpString += outputString.charAt(i);
		}
		outputString = outputString.replace(tmpString,"");
	}
	return outputString;
}
function cellIsLocked(obj){
	if(obj.locked != -1){
		return true;
	}
	else return false;
}
function processJob(state){
	if(state == "process"){
		top.topFrame.document.getElementById("sta_0").style.display = "none";
		top.topFrame.document.getElementById("sta_1").style.display = "block";
	}
	else {
		top.topFrame.document.getElementById("sta_1").style.display = "none";
		top.topFrame.document.getElementById("sta_0").style.display = "block";
	}
	//top.topFrame.document.all['logo'].src = "site/gifs/" + state + ".gif";
	return true;
}
function submitForm(win,nam){
	if(win.document[nam]) 
		obj = win.document[nam];
	else if(win.document.all[nam])
		obj = win.document.all[nam];
	else 
		obj = null;
	if(obj){
		processJob("process");
		obj.submit();
	}
}
function copyObjAttributes(obj_1,obj_2){
	for(k=0;k<obj_1.attributes.length;k++){
		oAttr = obj_1.attributes.item(k);
        bSpecified = oAttr.specified;
		if(bSpecified){
			sName = oAttr.nodeName;
			if(sName == "class") sName = "className";
			vValue = oAttr.nodeValue;
			obj_2.setAttribute(sName,vValue);
			//alert(oAttr.nodeType + ":" + sName + ":" + vValue);
		}
	}
}
var selfil = null;
function localFocusRow(obj){
	if(obj!=selfil){
		localReset(selfil);
		selfil = obj;
	}
	obj.setAttribute("className","panel_text_selected");
}
function localBlurRow(obj){
	obj.setAttribute("className","inactivecaption");
}
function localReset(obj){
	if(obj){
		obj.removeAttribute("className");
	}
}
var goDown = null;
function RowKeyPress(obj){
	window.event.cancelBubble = true;
	switch(event.keyCode){
		case 46:
			rowDelete(obj);
		break;
		case 40:
			rowDown(obj);
		break;
		case 38:
			rowUp(obj);
		break;
		case 13:
			if(obj.ondblclick){
				obj.fireEvent("ondblclick");
			}
		break;
		default:
			//alert(event.keyCode);
		break;
	}
	cancelEvent();
}
var deleteRow = null;
var msgArray = new Array();
msgArray[1] = "Confirm deletion?";
function rowDelete(obj){
	if(!isNaN(obj.del)){
		if(obj.del > 0){
			ok = confirm(msgArray[obj.del]);
		}
		else ok = true;
		if(ok){
			curTable = obj.parentElement;
			if(obj.nextSibling) focuRow = obj.nextSibling;
			else if(obj.previousSibling) focuRow = obj.previousSibling;
			else focuRow = null;
			curTable.deleteRow(obj.sectionRowIndex);
			deleteRow = 1;
			if(focuRow) focuRow.focus();
		}
	}
}
function rowUp(obj){
	goDown = false;
	if(obj.rowIndex > 0){
		try{
			obj.previousSibling.focus();
		}
		catch(e){
			if(obj.previousSibling)
				rowUp(obj.previousSibling);
		}
	}
}
function rowDown(obj){
	goDown = true;
	if(obj.rowIndex < obj.parentElement.rows.length-1){
		try{
			obj.nextSibling.focus();
		}
		catch(e){
			if(obj.nextSibling)
				rowDown(obj.nextSibling);
		}
	}
}
function errorExt(obj){
	obj.src = "site/gifs/ext/small/unknown.gif";
}
function changeButtonStatus(obj,bool){
	obj.disabled = bool;
	if(bool) alpha = 50;
	else alpha = 100;
	obj.firstChild.style.filter = "alpha(opacity=" + alpha + ")";
}
function isValidSelection(){
	selObj = document.selection;
	switch (selObj.type){
		case "Control" :
			tmpSelection = selObj.createRange();
			tmpParent = tmpSelection.item(0).parentElement;
		break;
		case "Text" :
			tmpSelection = selObj.createRangeCollection().item(0);
			tmpParent = tmpSelection.parentElement();
		break;
		default :
			tmpSelection = selObj.createRange();
			tmpParent = tmpSelection.parentElement();
		break;
	}
	while(tmpParent.tagName != "BODY"){
		if(tmpParent.isContentEditable){
			return true;
		}
		tmpParent = tmpParent.parentElement;
	}
	return false;
}
var linkObject = null;
function createLink(){
	if(tmpObject.tagName != "A"){
		switch (document.selection.type){
			case "Control" :
				tmpSelection = document.selection.createRange();
			break;
			case "Text" :
				tmpSelection = document.selection.createRangeCollection().item(0);
				if(tmpSelection.htmlText.indexOf("<A") != -1){
					return false;
				}
			break;
			default :
				rng = document.selection.createRange();
				rng.expand("word");
				if(rng.text.length > 0){
					rng.select();
					createLink();
				}
				return false;
			break;
		}
	}
	linkObject = null;
	while(tmpObject.tagName != "DIV" && tmpObject.tagName != "BODY"){
		if(tmpObject.tagName == "A"){
			linkObject = tmpObject;
			break;
		}
		tmpObject = tmpObject.parentElement;
	}
	if(!linkObject){
		if(!tmpSelection.execCommand("CreateLink",false,"http://")){
			linkObject = document.createElement("A");
			linkObject.href = "http://";
			linkObject.innerHTML = tmpSelection(0).outerHTML;
			tmpSelection(0).insertAdjacentElement("afterEnd", linkObject);
			document.selection.clear();
		}
		else{
			if(document.selection.type == "Control"){
				linkObject = tmpSelection.item(0).parentElement;
			}
			else{
				linkObject = tmpSelection.parentElement();
			}
		}
		linkObject.type = 0;
	}
	openDialogWindow("links.cfm",window,480,375,0,0);	
}
function setListValue(obj,nam){
	tmpArray = new Array();
	for(i=0;i<obj.options.length;i++){
		if(obj.options[i].selected){
			tmpArray.push(obj.options[i].value);
		}
	}
	obj.form[nam].value = tmpArray.toString();
}
function setSameValue(obj){
	for(i=0;i<obj.form.elements.length;i++){
		if(obj.id == obj.form.elements[i].id && obj != obj.form.elements[i]){
			for(j=0;j<obj.form.elements[i].options.length;j++){
				if(obj.form.elements[i].options[j].value == obj.options[obj.selectedIndex].value){
					obj.form.elements[i].options[j].selected = true;
					break;
				}
			}
		}
	}
}
function clearForm(obj){
	nb = obj.elements.length;
	for(j=0;j<nb;j++){
		obj.removeChild(obj.elements[0]);
	}
}
function isFormElement(obj){
	tag = obj.tagName;
	if(tag == "INPUT" || tag == "SELECT" || tag == "TEXTAREA"){
		return true;
	}
	else return false;
}
function setFocus(obj){}
function setBlur(obj){}
function pasteString(tmpHTML){
	curHTML = tmpHTML;
	
	s = tmpHTML.indexOf("<DEL");
	while(s != -1){
		e = tmpHTML.indexOf("</DEL>",s);
		m = tmpHTML.substr(s,e-s+6);
		curHTML = curHTML.replace(m,"");
		s = tmpHTML.indexOf("<DEL",e);
	}
	
	s = tmpHTML.indexOf("<");
	while(s != -1){
		e = tmpHTML.indexOf(">",s);
		m = tmpHTML.substr(s,e-s+1);
		w = m.indexOf(" ");
		if(w != -1) TAG = m.substr(1,w-1);
		else TAG = m.substr(1,e-s-1);
		
		switch(TAG.toUpperCase()){
			case "P":
			case "B":
			case "I":
			case "STRONG":
			case "EM":
			case "U":
			case "H1":
			case "H2":
			case "H3":
			case "H4":
			case "H5":
			case "H6":
			case "OL":
			case "UL":
			case "LI":
			case "/P":
			case "/B":
			case "/I":
			case "/STRONG":
			case "/EM":
			case "/U":
			case "/H1":
			case "/H2":
			case "/H3":
			case "/H4":
			case "/H5":
			case "/H6":
			case "/OL":
			case "/UL":
			case "/LI":
				curHTML = curHTML.replace(m,"<" + TAG.toLowerCase() + ">");
			break;
			case "BR":
			case "HR":
				curHTML = curHTML.replace(m,"<" + TAG.toLowerCase() + " />");
			break;
			case "A":
			case "/A":
			case "IMG":
			break;
			default:
				curHTML = curHTML.replace(m,"");
			break;
		}
	
		s = tmpHTML.indexOf("<",e);
	}
	return curHTML;
}
function getStruct(obj,c){
	var keyArray = new Array();
	for(var key in obj){
		keyArray.push(key+"="+obj[key]);
	}
	return keyArray.join(c);
}