function checkform() {
  var email = document.subscribeform.email.value;
  if(!isValidEmail(email) && email.length > 0) {
			alert("Bitte geben Sie eine gültige E-Mail Adresse an");
			return false;
	 }
  for (i=0;i<fieldstocheck.length;i++) {
	  
	
    if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "") {
      alert("Bitte geben Sie ein "+fieldnames[i]);
      eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
      return false;
    }
  }

  return true;
}

function isValidEmail(str) {
   return ((str.indexOf(".") > 2) && (str.indexOf("@") > 0));
}


function boxcolfocus(id){
	if (document.getElementById(id).defaultValue==document.getElementById(id).value) {
		document.getElementById(id).value = '';
		document.getElementById(id).setAttribute("class", "input_text_on");
	} 
}

function lin() { 
	
	if (document.userlink.vorname.value !=  document.userlink.vorname.defaultValue && document.userlink.nachname.value != document.userlink.nachname.defaultValue) {
			var location = document.userlink.vorname.value+'_'+document.userlink.nachname.value;
			document.userlink.action = location;
			document.userlink.submit(); //this.location.href=location;
		}
		
}

var fieldstocheck = new Array();
var fieldnames = new Array();
function addFieldToCheck(value,name) {
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}

function compareEmail()
{
  return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}




function PadDigits(n, totalDigits) { 
        n = n.toString(); 
        var pd = ''; 
        if (totalDigits > n.length) 
        { 
            for (i=0; i < (totalDigits-n.length); i++) 
            { 
                pd += '0'; 
            } 
        } 
        return pd + n.toString(); 
} 

function versenden(subject) {
var url=new String(window.location);
subject = escape(subject);
var vershref="mailto:?subject="+subject+"&body="+url;
document.getElementById('versenden').href = vershref;
}

function Copy(Firma)  {
today = new Date()
CurrentYear = today.getYear();
if(CurrentYear < 2000) { CurrentYear = CurrentYear + 1900; }
document.write("&copy " + CurrentYear + " " + Firma);
}

function Updated(PreText)  {
	if(document.lastModified.length > 0) { 
	da = new Date(document.lastModified) 	// Create a Date Object set to the last modifed date
	dy = da.getFullYear() 	// Get full year (as opposed to last two digits only)
	dm = da.getMonth() + 1 	// Get month and correct it (getMonth() returns 0 to 11)
	dd = da.getDate() 	// Get date within month
	if ( dy < 1970 ) dy = dy + 100; 	// We still have to fix the millennium bug
	ys = new String(dy) 	// Convert year, month and date to strings
	ms = new String(dm) 	 
	ds = new String(dd) 	 
	if ( ms.length == 1 ) ms = "0" + ms; 	// Add leading zeros to month and date if required
	if ( ds.length == 1 ) ds = "0" + ds; 	 
	ys = ds + "." + ms + "." + ys 	// Combine year, month and date in ISO format
	document.write(PreText + ys); // Display the result
	}
}

function prt_Date(Beschreibung)  {
today = new Date()
CurrentYear = today.getYear();
if(CurrentYear < 2000) { CurrentYear = CurrentYear + 1900; }
document.write(Beschreibung + " " + PadDigits(today.getDate(), 2) + "." + PadDigits((today.getMonth()+1), 2) + "." + CurrentYear);
}
function menu_goto( menuform )
{
    //var baseurl = "http://www.put-your-domain-name-here.com" ;
    selecteditem = menuform.newurl.selectedIndex ;
    newurl = menuform.newurl.options[ selecteditem ].value ;
    if (newurl.length != 0) {
      //location.href = baseurl + newurl ;
    }
}
function checkFormular(form) // Funktioniert nicht!!
{
valid = true;

var required= form.required.value ;
required = required.replace(" ","");
Arequired = required.split(",");

var compare= form.compare.value ;
compare = compare.replace(" ","");
compare = compare.split(",");

var warning_on_ID= form.warning_on_ID.value ;
warning_on_ID = warning_on_ID.replace(" ","");
warning_on_ID = warning_on_ID.split(",");

var warning_off_ID= form.warning_off_ID.value ;
warning_off_ID = warning_off_ID.replace(" ","");
warning_off_ID = warning_off_ID.split(",");

for(var i=0; i < required.length; i++)
	{
		
	var x = getElementsByTagName(required[i]);
	alert(x.value);
	if ( x.value == "" ) //&& document.getElementById(required[i])
    	{
			
		document.getElementById(required[i]).style.color = 'red';
		valid = false;
    	}
	else document.getElementById(required[i]).style.color = '';
	}

/*for(var i=0; i < form.compare.length; i++)
	{
	if ( form.compare[i].value != form.compare[i+1].value && document.getElementById(compare[i+1]))
    	{
		document.getElementById(compare[i+1]).style.color = 'red';
		valid = false;
    	}
	else document.getElementById(compare[i+1]).style.color = '';
	}
 */
 
 // also add thing to check that has email 'at'
 
 
 if ( valid == false )
	{
	 	document.getElementById('pflicht_1').style.display = 'none';
		document.getElementById('pflicht_2').style.color = 'red';
		document.getElementById('pflicht_2').style.display = 'block';
		document.getElementById('ueberprufen').style.color = 'red';
		document.getElementById('ueberprufen').style.display = 'block';
	}
 if (valid == true) {
	 	//form.submit();
    }
}
function searchsubmit() {
	var searchtext = document.getElementById('suchtext').value;
	searchtext2 =  searchtext + " site:.interaktiv-online.com";
	document.search.q.value = searchtext2;
	//document.q.value = searchtext2;
	//document.getElementById('suchtext').value = searchtext2;
	//document.getElementById('suchtext').value = searchtext;
	return true;
}