// JScript source code

var __IsNetscape = (navigator.appName == "Netscape");
//var __IsMSIE = (navigator.appName == "Microsoft Internet Explorer");
var __GroupID = "";


String.prototype.trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/g, "");
}

/**
* Function to emulate document.getElementById
*
* @param	string	Object ID
*
* @return	mixed	null if not found, object if found
*/
function fetch_object(idname)
{
	if (document.getElementById)
	{
		return document.getElementById(idname);
	}
	else if (document.all)
	{
		return document.all[idname];
	}
	else if (document.layers)
	{
		return document.layers[idname];
	}
	else
	{
		return null;
	}
}

function spell_check(object_id) 
{
	var obj = fetch_object(object_id);
	var val = obj.value.trim();

	obj.value = val;
	
	if (val == "")
	{
		alert("Enter Text");
		obj.focus();
		return false;
	}

	var w = 500;
	var h = 400;
	var x = (screen.width - w) /2;
	var y = (screen.height - h) / 2;
	var win;
	
	//win = window.open("http://www.micro-life.com/spellcheck.php?o=" + object_id + "&w=" + val, "spellcheck", 'height=' + h + ',width=' + w + ',top=' + y + ',left=' + x + ',scrollbars=yes,status=no,resizable=yes,copyhistory=yes');
	win = window.open("spellcheck.php?o=" + object_id + "&w=" + val, "spellcheck", 'height=' + h + ',width=' + w + ',top=' + y + ',left=' + x + ',scrollbars=' + scroll + ',resizable');
	
	return false;
}

function set_style_class(object_id, class_id)
{
	fetch_object(object_id).className = class_id;
}

function set_active_group_style_class(new_group_id, active_class_id , normal_class_id)
{
	if(__GroupID != "")
		set_style_class(__GroupID , normal_class_id);
	set_style_class(new_group_id , active_class_id);
	__GroupID = new_group_id;
}

