		function doLoad()
		{
			errorReport();
			dotime();
			initializeDate();
		}

	function getTZO()
	{
	 	var tzo=0;
	 	try
	 	{
	 		var d=new Date();
	 		var os=d.getTimezoneOffset();
	 		tzo=(os/60)*(-1);	 	
	 	}
	 	catch(e)
	 	{
	 	
	 	}
	 	
	 	return tzo;
	}
		
  function dotime() 
  {
	curtime = new Date();
	a = curtime.getTimezoneOffset()
	document.forms.entry.timeoffset.value=a;
  }

	function changeCountry(me,flag)
	{
		var t=document.getElementById(flag);
		var ccode=me.options[me.selectedIndex].value;
		t.src="http://www.vitalmessages.com/images/flags/"+ccode.toLowerCase()+".png"; 
	}

	
	function onCountryChange(v)
	{
		if(v)
		{		
			var t=document.getElementById(v);
			t.onchange();
		}
	}	
	
  var updating=false;
  function initializeDate()
  {
	if(document.forms.entry.activation_month)
	{
		updating=true;
		var now=new Date();

		document.forms.entry.activation_month.selectedIndex=(now.getMonth()-0);	
		document.forms.entry.activation_day.selectedIndex=now.getDate()-1;
		document.forms.entry.activation_hour.selectedIndex=now.getHours()-0;
		document.forms.entry.activation_minute.selectedIndex=now.getMinutes()-0;
		updating=false;
  
		var datestr=document.forms.entry.activation_day.value+" ";
		datestr+=document.forms.entry.activation_month.options[document.forms.entry.activation_month.selectedIndex].text+" ";
		datestr+=document.forms.entry.activation_year.value+" ";
				
		datestr+=document.forms.entry.activation_hour.value+":";
		datestr+=document.forms.entry.activation_minute.value+":00";
				
		var elem = document.getElementById('inf_activation_time');
		elem.firstChild.nodeValue = datestr; 
	} 
  }
  
	function changeDisplayOnCheck(chkb,target)
	{
		var t=document.getElementById(target);
		if(chkb.checked)
			t.style.display="";
		else
			t.style.display="none"
	}
  
  function updateActivation()
  {	
	if(document.forms.entry.activation_month)
	{
		if(!updating)
		{
			if(validateDate('activation_year','activation_month','activation_day','inf_activation_time'))
			{
				if(!validateFutureTime('activation_year','activation_month','activation_day','activation_hour','activation_minute',3,'inf_activation_time'))
				{
					// we need to automatically correct date to current
					updating=true;
					var now=new Date();

					document.forms.entry.activation_month.selectedIndex=(now.getMonth()-0);	
					document.forms.entry.activation_day.selectedIndex=now.getDate()-1;
					document.forms.entry.activation_hour.selectedIndex=now.getHours()-0;
					document.forms.entry.activation_minute.selectedIndex=now.getMinutes()-0;
					updating=false;
				}

				var datestr=document.forms.entry.activation_day.value+" ";
				datestr+=document.forms.entry.activation_month.options[document.forms.entry.activation_month.selectedIndex].text+" ";
				datestr+=document.forms.entry.activation_year.value+" ";
				
				datestr+=document.forms.entry.activation_hour.value+":";
				datestr+=document.forms.entry.activation_minute.value+":00";
				
				var elem = document.getElementById('inf_activation_time');
				elem.firstChild.nodeValue = datestr;  
			}
		}
	 }
  }