function submitform(action)
{
  document.profile.action = action;
  document.profile.submit();
}


function disp_confirm(ID,record,path)
  {
  var r=confirm("Do you really want to remove the record '"+record+"' from the database!");
  if (r==true)
    {
	document.profile.state.value = 'remove';
	document.profile.sqlID.value = ID;
    submitform(path);
    }
  else
    {
    
    }
  } 
  
   /* This function make a popup window with a href here is an example
  <a href="javascript:Popup('.$sql[ID].');">Example</a>
  below popup.php is a page that gets the sql id from the querystring and then extracts that from the database and populates the page
  with that*/
 function Popup() {
	 var w = 950;
	 var h = 650;
	 var winl = (screen.width - w) / 2;
     var wint = (screen.height - h) / 2;
     winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=1,scrollbars=1'
window.open( "login.php", "myWindow",winprops )
}
 function Popup2(ID,State) {
	 var w = 950;
	 var h = 650;
	 var winl = (screen.width - w) / 2;
     var wint = (screen.height - h) / 2;
     winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=0'
window.open( "newsForm/Popup.php?ID="+ID, "myWindow",winprops ) 
}
