function openNewWindow(url, winname, winprops) {
	if (url != '') {
		window.open(url, winname, winprops);
	}
}

function checkSearchForm() {
	if (document.search.searchtext.value == "Enter Keywords") {
		alert("please enter a Keyword.");
		document.search.searchtext.focus();
		return false;
	}
	if (document.search.searchlist.selectedIndex == 0)
		{
			alert("please select a Search Option.");
			document.search.searchlist.focus();
		return false;
	}

}


function ValidateSearchForm() {
	var SearchString = document.SearchForm.search_word.value;
	if ((SearchString.length < 3)||( document.SearchForm.search_word.value == "Enter Keywords")) {
		alert("Search phrase must be at least 3 characters in length.");
		document.SearchForm.search_word.focus();
		return false;
	}
	else {
		return true
	}	

}

function outLinks()
{
	var d = document.links; 
	var j = "javascript:"; 
	var b = "_blank";
	var dom = document.domain;
    //alert("Old dom " + dom);
	dom = replace(dom,":"+location.port,"");
    //alert("New dom " + dom);
	for (var i = 0; i < (d.length); i++) 
		if (d[i].protocol != j & d[i].hostname != dom & d[i].hostname == "ltu.thecollective.com") 
		{
          d[i].hostname = dom ; 
          d[i].port = location.port ;
		}
}
window.onload = function() { outLinks() }; 

function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

function Launch(url,n,w,h) {
   lWin=window.open(url,n,"menubar=no,scrollbars=auto,status=no,width="+w+",height="+h+",top=300,left=300")
}
function LaunchScrl(url,n,w,h) {
   lWin=window.open(url,n,"menubar=no,scrollbars=yes,status=no,width="+w+",height="+h+",top=300,left=300")
}