
function show_div(tid)
{
	var tt=document.getElementById(tid);
	if 	(tt.style.display=="none")
	{tt.style.display="block";
	}
	else
	{
	tt.style.display="none";	
	}
}


function validate_required(field,alerttxt)
{
	with (field)
		{
			if (value==null||value==""||value=="0")
			  {alert(alerttxt);return false}
			else {return true}
		}
}

function validate_form(thisform)
{
	with (thisform)
	{
	if (validate_required(txtname,"Enter your Name  first!")==false)
	  {txtname.focus();return false}
	else if (validate_required(txtcomments,"Comment box could not be empty. Please put some comments first.")==false)
	  {txtcomments.focus();return false}
	}
}

function stat_log(scope, id)
{
	// Create new JS element
    var jsel = document.createElement('SCRIPT');
    var url='http://www.vistaback.com/';
    jsel.type = 'text/javascript';
    
    jsel.src = url + "ajax.php?type=putget&key=stat-log&scope=" + scope + "&id=" + id;
 // Append JS element (therefore executing the 'AJAX' call)
    document.body.appendChild (jsel);
}
