// string to bin calc function
function toBin(input)
{  
   var outStr = new String();   
   for(var i = 0; i < input.length; i++)
   {
       var ch = new String();
       ch = input.charCodeAt(i);
       ch = ch.toString(2);
       
       if(input.charCodeAt(i) <= 63)               
       {           
           outStr += "00" + ch;
       }
       else if(input.charCodeAt(i) >= 178)
       {
	       outStr += ch;
       }	   
       else                   
       {                       
           outStr += "0" + ch;        
       }
   }   
   document.outForm.binOut.value = outStr;
   
   return;
}

// ubde footer function (call the string)
function ubdeFooter()
{
    var footer = "...::: powered by Upbloggen.de :::...";
    document.write(footer.small(1));    
}

// leap-year calc function
function leapYear(input)
{
	var outStr = new String();

	if((!isNaN(parseInt(input))) && (input.length >= 4))
	{	
		if ((input % 4 == 0) && (input % 100 != 0) || (input % 400 == 0))
		{		
			outStr = "Anno " + input + " ist ein Schaltjahr.";
		}
		else
		{
			outStr = "Anno " + input + " ist kein Schaltjahr.";		
		}
	}
	else
	{
		outStr = "Bitte das Jahr mit mind. vier Stellen und als Zahl eingeben!";
	}	
	document.yearOutForm.yearOutStr.value = outStr;
	
	return;
}
