var connector = function(){

}

connector.prototype.tjek = function()
{
  return true;
}
connector.prototype.load_script = function(script_filename)
{

	if (navigator.appName=="Microsoft Internet Explorer" && script_filename.length>2048) alert("System fejl! post lenght = "+script_filename.length+", kontakt system ansvarlig!");
	if (navigator.appName=="Netscape" && script_filename.length>8000) alert("System fejl! post lenght = "+script_filename.length+", kontakt system ansvarlig!");
	this.html_doc = document.getElementsByTagName('head').item(0);
	if (this.js_file) this.html_doc.removeChild(this.js_file);
  this.js_file = document.createElement('script');
  this.js_file.setAttribute('language', 'javascript');
  this.js_file.setAttribute('type', 'text/javascript');
  this.js_file.setAttribute('src', script_filename);
  var ret = this.html_doc.appendChild(this.js_file);
  if (typeof ret == "object") return ret;
  return false;
}

connector.prototype.Server_Connector = function(connector,include,funktion,CallBackObj,CallBackFunction,variabler)
{
  connectString = connector+"?include="+include+"&funktion="+funktion+"&CallBackObj=" + CallBackObj +"&CallBackFunction="+CallBackFunction;
  if (variabler) connectString += variabler;
	return this.load_script(connectString);
}

connector.prototype.sendTime = function()
{	
  now = new Date();
  nuTid = now.getTime()
  this.scriptName= "connector.php?nowTime="+nuTid;
  this.load_script(this.scriptName);
}

connector.prototype.sendDate = function()
{	
  if (arguments[0]) this.data="?"+arguments[0];
  for (nsd=1; nsd<arguments.length; nsd++)
  {
	  this.data+= "&"+arguments[nsd];
	}
  this.scriptName= "connector.php"+this.data;
  this.load_script(this.scriptName);
}

connector.prototype.sendDateTo = function()
{	
  if (!arguments[0]) return;
  if (arguments[1]) this.data="?"+arguments[1];
  for (nsd=2; nsd<arguments.length; nsd++)
  {
	  this.data+= "&"+arguments[nsd];
	}
  this.scriptName= arguments[0]+this.data;
  this.load_script(this.scriptName);
}

