var VersionAllSync = "3.5.12"
var VersionAllDup = "3.3.25"
var VersionGetFoldersize = "2.5.0"

function CopyToClipboard(id) {
   document.getElementById(id).focus();
   document.getElementById(id).select();
   CopiedTxt = document.selection.createRange();
   CopiedTxt.execCommand("Copy");
}

function GoToForum(id){
	Offline(id);
	top.location.href = URL 
}

var ASP = "http://www.thummerer-software-design.de/asp/"
var Lokal = "http://localhost/asp/"
var URL = ASP;

function LogOnReg(){
	Offline(1);
	top.location.href = URL + "regb.asp"
}

function LogOnRegEng(){
	Offline(1);
	top.location.href = URL + "regb_eng.asp"
}

function LogOnReseller(){
	
	Offline(1);
	top.location.href = URL + "reseller.asp"
}

function LogOnResellerEng(){
	
	Offline(1);
	top.location.href = URL + "reseller_eng.asp"
}

function JumpToNewsletter(){
	
	Offline(1);
	top.location.href = URL + "newsletter.asp"
}

function Offline(id){
	
	/* id=1 asp */
	/* id=2 forum deutsch */
	/* id=3 forum EN */
	
	if ( document.location.href.substr(0,15).toLowerCase() == "http://192.168." || document.location.href.substr(0,16).toLowerCase() == "http://localhost")
	{
		if (id == 1)
			URL = Lokal;
		else
		{
			if (id == 2)
				URL = "http://localhost/phpBB2/index.php?lg=german";
			else
				URL = "http://localhost/phpBB2/index.php?lg=english";
		}
	}	
	else
	{
		if (id == 1	)
			URL = ASP;
		else
		{
			if (id == 2)
				URL = "http://www.allsync.biz/phpBB2/index.php?lg=german"
			else
				URL = "http://www.allsync.biz/phpBB2/index.php?lg=english"
		}
	}
}

function Offline1(){
	
	var tmp;
	tmp = document.location.href
	
	if ( tmp.substr(0,15).toLowerCase() == "http://192.168.")
	{
		URL = Lokal;
		var Ergebnis = tmp.match("http://([^/]*)/");
		alert(Ergebnis);
		var test = Ergebnis.search(/,/);
		alert(test);
	}
	else 
	{
		if ( tmp.substr(0,16).toLowerCase() == "http://localhost")
		{
		var Ergebnis = tmp.match("http://([^/]*)/");
		alert(Ergebnis);
		var test = Ergebnis.search(",");
		alert(test);
		URL = Lokal;
		}
		else
		{
			URL = ASP;
		}
	}
}



var SpamCode = 491;

var CheckEmail = "Die Emailbestätigung ist nicht korrekt!";
var CheckSpam = "Spamschutz: Der eingegebene Zahlencode ist nicht korrekt!";
var CheckFeld = "Füllen Sie bitte alle Textfelder aus, die mit einem Stern (*) markiert sind.";

var CheckEmailEN = "Your e-mail address does not match in the Email and Email Verify fields!";
var CheckSpamEN = "The code of the spam protection does not match!";
var CheckFeldEN = "Fields with * must be completed to process your request!";

/* **************** */
/* FORMULAR Kontakt */
/* **************** */

function CheckEingabenKontaktEN()
{
	document.form1.spamcode.value = SpamCode;
	
	if (document.form1.securetext.value == "" || document.form1.betreff.value == "" || document.form1.mitteilung.value == "" || document.form1.name1.value == ""  || document.form1.email.value == "" || document.form1.email2.value == "")
		alert(CheckFeldEN);
	else
	{
		if (document.form1.email.value != document.form1.email2.value)
			alert(CheckEmailEN);
		else
		{
			if (document.form1.securetext.value != SpamCode)
				alert(CheckSpamEN);
			else
				document.form1.submit();
		}
	}
}

function CheckEingabenKontakt()
{
	document.form1.spamcode.value = SpamCode;
	
	if (document.form1.securetext.value == "" || document.form1.betreff.value == "" || document.form1.mitteilung.value == "" || document.form1.name1.value == ""  || document.form1.email.value == "" || document.form1.email2.value == "")
		alert(CheckFeld);
	else
	{
		if (document.form1.email.value != document.form1.email2.value)
			alert(CheckEmail);
		else
		{
			if (document.form1.securetext.value != SpamCode)
				alert(CheckSpam);
			else
				document.form1.submit();
		}
	}
}


/* **************** */
/* FORMULAR Support */
/* **************** */

function CheckEingabenSupportEN()
{
	document.form1.spamcode.value = SpamCode;
	
	if (document.form1.securetext.value == "" || document.form1.betreff.value == "" || document.form1.product.value == "" || document.form1.os.value == "" || document.form1.version.value == "" || document.form1.mitteilung.value == "" || document.form1.name1.value == ""  || document.form1.email.value == "" || document.form1.email2.value == "")
		alert(CheckFeldEN);
	else
	{
		if (document.form1.email.value != document.form1.email2.value)
			alert(CheckEmailEN);
		else
		{
			if (document.form1.securetext.value != SpamCode)
				alert(CheckSpamEN);
			else
				document.form1.submit();
		}
	}
}

function CheckEingabenSupport()
{
	document.form1.spamcode.value = SpamCode;
	
	if (document.form1.securetext.value == "" || document.form1.betreff.value == "" || document.form1.product.value == "" || document.form1.os.value == "" || document.form1.version.value == "" || document.form1.mitteilung.value == "" || document.form1.name1.value == ""  || document.form1.email.value == "" || document.form1.email2.value == "")
		alert(CheckFeld);
	else
	{
		if (document.form1.email.value != document.form1.email2.value)
			alert(CheckEmail);
		else
		{
			if (document.form1.securetext.value != SpamCode)
				alert(CheckSpam);
			else
				document.form1.submit();
		}
	}
}

