
function ClearSearch() 
{
	if((document.Search.search_keyword.value == "Enter Keyword")  || (document.Search.search_keyword.value == "Search"))
	{
		document.Search.search_keyword.value = "";
	}
}

//this function check if need to just change the range status or change the status and do the search  
function searchChange(id)
{
	document.getElementById(id).checked = true;
}


function get_url(link_url, blank) {
	if(blank) {
		var wref = window.open(link_url);
	} else {
		document.location.href = link_url;
	}
}

/* Start Top Navigation menu */ 
function mainMenuOn(ellementId) {
	var curEllement = document.getElementById(ellementId);
	curEllement.style.backgroundColor = '#75B85A';
	document.getElementById(ellementId).style.overflow = "visible";
}
	 
function mainMenuOff(ellementId){
	var curEllement = document.getElementById(ellementId);
	curEllement.style.backgroundColor = '#4CAA26';
	document.getElementById(ellementId).style.overflow = "hidden";
}

function checkUrlForMenu(currentMenuIetm) {
	document.getElementById(currentMenuIetm).style.backgroundColor='#44b4bc';
	document.getElementById(currentMenuIetm).style.marginTop='-9px';
}
/* End top navigation menu */	

/* Query Lib */
var gl_query = this.location.href;
var gl_inq = gl_query.indexOf('?');
gl_query = gl_query.substring(gl_inq + 1);

/**
* Return the values of the requested parameter from the URL
* @param param_name string
* @author Lee Eden
**/
function find_url_param(param_name) {
	var param_loc = gl_query.indexOf(param_name+"=");
	if(param_loc > -1) {
		var param_val = gl_query.substring(param_loc+param_name.length+1);
		if(param_val.indexOf('&') > -1) {
			param_val = param_val.substring(0,param_val.indexOf('&'));
		}
		param_val = unescape(param_val);
		return param_val;
	} else {
		return false;
	}
}

//------------ Start of Google Search ----------------------
// this function checks if we need to just change the range status or change the status and do the search  
function execSearch(gRange)
{
	var keyword = document.getElementById("search_keyword").value;
	g_page_mode = gRange;
	document.getElementById("sbar-range").value = g_page_mode;
	var web_color = "#025655";
	var web_decoration = "underline";
	var web_weight = "normal";
	var site_color = "#025655";
	var site_decoration = "underline";
	var site_weight = "normal";
	var people_color = "#025655";
	var people_decoration = "underline";
	var people_weight = "normal";
	var img_color = "#025655";
	var img_decoration = "underline";
	var img_weight = "normal";
	var video_color = "#025655";
	var video_decoration = "underline";
	var video_weight = "normal";

	switch(gRange) {
		case 'web': web_color = "#000"; web_decoration = "none"; web_weight = "bold"; break;
		case 'site': site_color = "#000"; site_decoration = "none"; site_weight = "bold"; break;
		case 'people': people_color = "#000"; people_decoration = "none"; people_weight = "bold"; break;
		case 'img': img_color = "#000"; img_decoration = "none"; img_weight = "bold"; break;
		case 'video': video_color = "#000"; video_decoration = "none"; video_weight = "bold"; break; 	}
	
	document.getElementById("web").style.color = web_color;
	document.getElementById("web").style.textDecoration = web_decoration;
	document.getElementById("web").style.fontWeight = web_weight;
	document.getElementById("site").style.color = site_color;
	document.getElementById("site").style.textDecoration = site_decoration;
	document.getElementById("site").style.fontWeight = site_weight;
	document.getElementById("people").style.color = people_color;
	document.getElementById("people").style.textDecoration = people_decoration;
	document.getElementById("people").style.fontWeight = people_weight;
	document.getElementById("img").style.color = img_color;
	document.getElementById("img").style.textDecoration = img_decoration;
	document.getElementById("img").style.fontWeight = img_weight;
	document.getElementById("video").style.color = video_color;
	document.getElementById("video").style.textDecoration = video_decoration;
	document.getElementById("video").style.fontWeight = video_weight;
}

function submitSrch() {
	var keyword = document.getElementById("search_keyword").value;
	var search_mode = '';
	
	if	(keyword != '')
		document.getElementById("search").submit();
	else
		window.open("http://search.icq.com/","_parent");

	return false;
}

//check if search text exist and if so search otherwise do nothing
function submitGSrch(frm) {
	var ret = false; 
	var elmSrch = document.getElementById('d02-txt');
	
	if(elmSrch.value != "")
	{
		ret = true;
	}
	else parent.document.location.href = "http://search.icq.com/"
	return ret;
}
//------------ End of Google Search ----------------------
