
//------------browser type-----------
isIE=document.all;
isNN=!document.all&&document.getElementById;
//------------browser type-----------

function clearTextBoxDefault(textBoxObj,baseValue)
{
	if (textBoxObj.value=="")
	{
		textBoxObj.value=baseValue;
	}
	else if (textBoxObj.value==baseValue)
	{
		textBoxObj.value="";
	}
}


//--------------object getting - cross browser------------
function get_object(objName)
{
	if (isIE)
	{
		evalText="document.all."+objName;
		Obj=eval(evalText);
	}
	else
	{
		Obj=document.getElementById(objName);
	}
	return Obj;
}

function get_hidden_obj(objName,form_name)
{
	if (isIE)
	{
		evalText="document.all."+objName;
		Obj=eval(evalText);
	}
	else
	{
		evalText="document."+form_name+"."+objName;
		Obj=eval(evalText);
	}
	return Obj;
}
//--------------object getting - cross browser------------


function isArray(obj)
{
	return(typeof(obj.length)=="undefined")?false:true;
}



function select_object(obj_id,form_name,hiddenName)
{
	var hiddenObj = eval('document.'+form_name+'.'+hiddenName);
	hiddenObj.value=obj_id;
}

function isValidEmail(str) {
   return (str.indexOf("@") > 0);
}

function validateEmail(str)
{
	var x=str;
	var atpos=x.indexOf("@");
	var dotpos=x.lastIndexOf(".");
	if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
	{
		  return false;
	}
    return true;
}
