//<!--
//=====================================
// FTH: New window opens for every new winName
function openRelativeWindow(strURL,winName) 
{
	var winWidth = Math.round(screen.availWidth * 0.8)
	var winLeft = Math.round(screen.availWidth * 0.1)
	winProperties = 'width='+winWidth+',left='+winLeft+',top=0,height=0,toolbar=yes,location=yes,status=no,menubar=yes,scrollbars=yes,resizable=yes'
	window.open(strURL, winName, winProperties)
}

//=====================================
// FTH: open pop up window
function openWin(theURL,winName,W,H)
{
	features = 'height='+H+',width='+W+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1'
	window.open(theURL,winName,features);
}

//=====================================
// FTH: open pop up window
function openMovie(theURL)
{
	winName = 'sxVideo'
	W = 480
	H = 360
	winTop = 100
	winLeft = 200
	features = 'height='+H+',width='+W+',top='+winTop+',left='+winLeft+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1'
	window.open(theURL,winName,features);
}
//=====================================
// FTH: A New centered window opens for every new winName
function openCenteredWindow(strURL, winName, w, h)
{
	if (w == 0 || w == ''){
		w = (screen.width - 160);
		var winLeft = 0;
	}else{
		var winLeft = Math.round((screen.width - w) / 2);
	}
	if (h == 0 || h == ''){
		h = (screen.height - 165);
		var winTop = 0;
	}else{
		var winTop = Math.round(((screen.height - 200) - h) / 2);
	}
	winProperties = 'height='+h+',width='+w+',top='+winTop+',left='+winLeft+',location=1,status=0,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes'
	window.open(strURL, winName, winProperties)
}

//=====================================
// FTh: Change class
function changeClass(cell, newClass)
	{
	cell.className = newClass;
	}	

//=====================================
// FTh: Change class by ID Name
function changeClassByID(idName, newClass)
	{
	document.getElementById(idName).className = newClass;
	}

//=====================================
// FTh: Change class by ID Name
function changeBetweenClasses(idName, newClass, oldClass)
	{
	var sxElement = document.getElementById(idName)
	sxElement.className = (sxElement.className == newClass) ? oldClass : newClass;
	}

//=====================================
// FTh - Show and Hide Layers
function showBox(BoxID)
{
	var layerBox = document.getElementById(BoxID)
	layerBox.style.display = (layerBox.style.display == 'none') ? 'block' : 'none';
}

//=====================================
// FTh - Change inner HTML
function changeHTML(htmlID, currentContent, newContent)
{
	var sxHTML = document.getElementById(htmlID)
	sxHTML.innerHTML = (sxHTML.innerHTML == currentContent) ? newContent : currentContent;
}

//Used in orderShowCurrent - Replaces the above one....
function showHideLayer(thisID,thatID,firstImg,secondImg)
{
	var layer = document.getElementById(thatID);
	if (layer.style.display == 'none')
	{
		layer.style.display = 'block';
		layer = document.getElementById(thisID);
      layer.innerHTML = '<img border="0" src="'+firstImg+'">';
	} else {
		layer.style.display = 'none';
		layer = document.getElementById(thisID);
		layer.innerHTML = '<img border="0" src="'+secondImg+'">';
	}
}
//=====================================
// Opens a link from a form selection
// onchange=submitSelection(this.form), selectedOption is the name of the selection field
function submitSelection(form) 
{
	location=form.selectedOption.value
}

//=====================================
// Opens a link from ANY form selection
// onchange=submitMultiSelection(this.form.selectionFieldName)
function submitMultiSelection(form)
{
//	location=form.value
	location=form.value
}


function formSubmit(myForm)
{
document.getElementById(myForm).submit()
}


// FTh - Change Layers and Link colors by Tabs
function showlayer(layer,sxName)
{
	i = 0
	while (document.getElementById(sxName+i) != null)
	{
		document.getElementById(sxName+i).style.display = (layer == (sxName+i)) ? 'block' : 'none';
	i++
	}
	return false;
}

//FTh Changes the color of a text counter box when max length is exceeded.
function countRepEntries() 
{
   var sxv = document.forumArticles.textbody.value;
   var sxl = sxv.length;
   document.forumArticles.entered.value = sxl;
   var sxs = document.forumArticles.entered.style;
   sxs.backgroundColor = (sxl >= 6000) ? '#dd0000' : '#ffffff';
   setTimeout("countRepEntries()" ,0);
}

//FTh Changes the color of a text counter box when max length is exceeded.
function countNewEntries() 
{
   var sxv = document.forumArticles.textbody.value;
   var sxl = sxv.length;
   document.forumArticles.entered.value = sxl;
   var sxs = document.forumArticles.entered.style;
   sxs.backgroundColor = (sxl >= 12000) ? '#dd0000' : '#ffffff';
   setTimeout("countNewEntries()" ,0);
}

//-->




