function checkField() {
	var errormessage;
	var flagerror;
	var currencyerror;
	
	errormessage = "I am sorry, the following error(s) have occured. \n _________________________________________________________\n";
	flagerror = 0;
	
	if (document.ASearch.Song_Title.value == "" && document.ASearch.Artist.value == "" && document.ASearch.Album_Title.value == "") {
		errormessage = errormessage + "\n Song Title or Artist or Album Title must be entered to search!";
		flagerror = 1;
	}	
	
	if (document.ASearch.category_operator.options[document.ASearch.category_operator.selectedIndex].value == "not" && document.ASearch.SongCategoryName.options[document.ASearch.SongCategoryName.selectedIndex].value == 0) {
		errormessage = errormessage + "\n All Song Categories can not be excluded from a search!";
		flagerror = 1;
	}	
	
	if (document.ASearch.Song_Title.value.length < 2 && document.ASearch.Artist.value.length < 2 && document.ASearch.Album_Title.value.length < 2) {
		errormessage = errormessage + "\n You must have at least 2 characters in order to search!";
		flagerror = 1;
	}
	
	if (flagerror == 1) {
		errormessage = errormessage + "\n_________________________________________________________\n\n Thank You.";
		alert(errormessage);
		return false;
	}
	leaving=0;
}

/***** for basic search *******/
function searchCheck(objFrm){
	/***if (objFrm.SearchBox.value == 'Enter Search Term' || objFrm.SearchBox.value == '' || objFrm.SearchBox.value.length  < 2) { 
		alert("Please enter a valid search string");
		return false;***/
	if (objFrm.searchstr.value == 'SEARCH' || objFrm.searchstr.value == '' || objFrm.searchstr.value.length  < 2) { 
		alert("Please enter a valid search string");
		return false;
	} else if (objFrm.SearchMethod.value == "Web") {
		window.open("../siafRR.cfm?SearchBox="+objFrm.searchstr.value+"&SearchMethod="+objFrm.SearchMethod.value+"");
		return false;
	}
	return true;
}
function searchvalidate(objFrm){
	
	if(objFrm.CategoryList.options[objFrm.CategoryList.selectedIndex].value=="" && objFrm.MainIng.options[objFrm.MainIng.selectedIndex].value=="" && (objFrm.searchstr.value == "" || objFrm.searchstr.value=="Enter Search Term Here")){
		alert("You must input a value or Select 3 of the Search Options!");
		return false;
	}		
	else
		return true;
}	

var tempvar=0;
function clearValue(){
	if (tempvar==0){
		document.myform.SearchBox.value="";
		tempvar=1;
	}	
}

var tmpvar = 0;
function clearSearchBox(objFrm) {
	if(tmpvar == 0) {
		objFrm.SearchBox.value="";
		tmpvar = 1;
	}
}


/* BOOKMARK BUTTON INTENSE CODE BELLOW */
function CreateBookmarkLink(title,url) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} 
	else if( window.external ) { // IE Favorite
		window.external.AddFavorite(url, title); 
	}
	else if(window.opera && window.print) { // Opera Hotlist
		return true; 
	}
}
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

	function copyit(theField) {
	var selectedText = document.selection;
		if (selectedText.type == 'Text') {
			var newRange = selectedText.createRange();
			newRange.execCommand("Copy");
		} else {
			alert('select a text in the page and then press this button');
		}
	}
function validate() 
{

	<!-- validate Search Box (Text Box) required //-->
	if(document.search.searchstr.length==0)
		{
		alert("You must enter a search criteria!");
		document.search.searchstr.focus();
		document.search.searchstr.select();
		return false;
		}
}