function trim(s)
{
    while (s.substring(0,1) == ' ') 
    {
        s = s.substring(1,s.length);
    }
    
    while (s.substring(s.length-1,s.length) == ' ') 
    {
        s = s.substring(0,s.length-1);
    }
    
    return s;
}

function check_empty(ctrl, form, ctrlname)
{
	obj = eval("document." + form + "." + ctrl)
    the_obj = trim(obj.value)	

        if (!obj)
	{
		alert (ctrl + " is not an object.")
		return 0
	}
	
        if (the_obj == '')
	{
		alert ("Kindly fill in the " + ctrlname + ".")
		obj.focus();
		return 1
	}
	return 0
}

function open_win(section)
{
    var win = window.open("pic.asp?section=" + section, "WIN", "top=0,left=0,width=600,height=600");
	win.focus();
    return false;
}