<!-- Begin //
var SrchBtn_clicked = false;
function clear_SrchText(SrchObj)
{
	if((SrchBtn_clicked == false) && (SrchObj.value == "Enter Keyword"))
	{
	    SrchObj.value = "";
	    SrchBtn_clicked = true;
	}

}

function replaceall(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 += replaceall(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}


function submit_action(formname, type, position) {
    d = document.forms[formname];
    if ((d.elements['q'].value.length == 0) || (d.elements['q'].value == "Enter Keyword"))
    {
	alert("Please enter a search keyword !");
	return false;
    }
    else
    {
	d.action = '/' + replaceall(d.elements['q'].value," ","_") +".cfm?nft=1&t=" + type + "&p=" + position;
    }
    return true;
}

function url_change(url) {
    window.location = url;
}





function changeStatus(keyword) {
    window.status = keyword;
    return true;
}

function PopNav(Url)
{
	if(Url != "-1" && Url != "-1")
	{
		location.href = Url;
	}
}


function addbookmark()
{
	bookmarkurl="http://www.urlredirecting.com"
	bookmarktitle="Welcome To FREE URLRedirecting.com"
	if (document.all)
		window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function confirmDelete (frm) {
	// loop through all elements
	for (i=0; i<frm.length; i++) {
		// Look for our checkboxes only
		if (frm.elements[i].name.indexOf ('DeleteThis') !=-1) {
			// If any are checked then confirm alert, otherwise nothing happens
			if(frm.elements[i].checked) {
				return confirm ('Are you sure you want to delete your selection(s)?')
			}
		}
	}
}

function select_deselectAll (chkVal, idVal) {
	var frm = document.forms[0];
	// loop through all elements
	for (i=0; i<frm.length; i++) {
		// // Look for our Header Template's Checkbox
		if (idVal.indexOf ('CheckAll') != -1) {
			// Check if main checkbox is checked, then select or deselect datagrid checkboxes 
			if(chkVal==true) {
				if (frm.elements[i].id.indexOf('DeleteThis')!=-1)	//To make sure any other check boxes inthe grid won't affect
					frm.elements[i].checked = true;
			} else {
				if (frm.elements[i].id.indexOf('DeleteThis')!=-1)	//To make sure any other check boxes inthe grid won't affect
					frm.elements[i].checked = false;
			}
			// Work here with the Item Template's multiple checkboxes
		} else if (idVal.indexOf('DeleteThis')!= -1) {
			// Check if any of the checkboxes are not checked, and then uncheck top select all checkbox
			if(frm.elements[i].checked == false) {
				//if (frm.elements[i].id.indexOf('DeleteThis')!=-1)	//To make sure any other check boxes inthe grid won't affect
					frm.elements[1].checked = false; // Check if any of the checkboxes are not checked, and then uncheck top select all checkbox
			}
		}
	}
}

//  End -->