function confirmation(meldung,path){
	var check=confirm(meldung);
	if(check==true)	{
		location=path;
	};
}


function sendTrans(str){
	OpenUrl('/turkbiz/incessant.de/tarns.php',600,400,'transWin');
	document.transF.text.value=str;
	document.transF.submit();
}


function changIMG(pic,scr){
	document.images[pic].src="/turkbiz/incessant.de/img/"+scr;
}


function chekcMail(mail){
	var error="false"; 
	strTemp = " " + mail;
    if (strTemp.indexOf("@") == -1 && strTemp.indexOf(".") == -1){
		error= "false";
	 }else  error= "true";
	 
	return error;
}


function OpenUrl(url,breite,hoehe,name){
	newWin=window.open(url,name,"status=no,toolbar=no,location=no,scrollbars=yes,menu=no,width="+breite+",height="+hoehe+",resizable=yes,left=20,top=40");
	newWin.focus();
}

function checkID(id){
	id2=id.replace(/-/g,"_");
	id2=id2.replace(/^_/,"-");
	id2=id2.replace(/_$/,"-");
	
	
	Suche = /\W/;
	Ergebnis = Suche.test(id2);
	if(Ergebnis == true || id2.length<3)
		return "false";
	else 
		return "true";
}


function checkSub(id){
	id2=id.replace(/-/g,"xx");
	id2=id2.replace(/^-/,"xx");
	id2=id2.replace(/-$/,"xx");
	
	id2=id2.replace(/_/g,"$");
	id2=id2.replace(/^_/,"$");
	id2=id2.replace(/_$/,"$");
	
	Suche = /\W/;
	Ergebnis = Suche.test(id2);
	if(Ergebnis == true || id.length<3)
		return "false";
	else 
		return "true";
}


function chekForm(num,from,to,alarm){
	var form=1
	for(i=from;i<to;i++){
		field=document.forms[num].elements[i];
		if(field.value==""){
			form=0;
			if(field.name=="email"){
				mail=chekcMail(field.value);
				if(mail=="false") 
					alert('Wrong email');
					field.focus();
					return true;
					break;
			}
			alert(alarm);
			field.focus();
			return true;
			break;
		}
	}
	
	
	if(form==1){
		mail=chekcMail(document.forms[num].email.value);
		if(mail=="false"){
			form=0; 
			alert('Wrong email');
			document.forms[num].email.select();
		}	
	}
	
	if(form==1){
		document.forms[num].submit();
	}	
} 

function toMainPage(url){
	if(opener){
		opener.location.href=url
		self.close();
	}else{
		document.location=url;

	}
}

function checkDate(datum){
	var myDate = new Date();
	var myDay = myDate.getDate();
	var myYear = myDate.getYear();
	var myMonth = myDate.getMonth();
	
	if(!datum) 
	return false;
	
 	datum=datum.toString();
	
 	datum=datum.split(".");
	
	if (datum.length!=3)
	return  false;
	
	datum[0]=parseInt(datum[0],10);
	datum[1]=parseInt(datum[1],10)-1;
	 
	check = new Date(datum[2],datum[1],datum[0])
	
	if(check.getDate()==datum[0] && check.getMonth()==datum[1] && check.getYear()==datum[2])
		return  true;	
	else
		return  false;
	
	if(datum[2].length!=2)
		return  false;

}


//foreignCats= new Array(1,13,24,36,45,64,71,80,95,104.113,122,113,120);
/*
function checkOpt(src){
	for(i=0;i<foreignCats.length;i++){
		if(foreignCats[i]==src.selectedIndex){
			alert('Sie haben im Branchenfeld eine (rot gekennzeichnete) Oberbranche ausgewählt.\n\rBitte wählen Sie statt dessen eine Unterbranche aus!\n\r\n\rBrans Bölümünde kirmizi ve büyük harfli olan Üst Branslari secmeyiniz.\n\rLütfen bir Alt Brans seciniz.');
			src.selectedIndex=0;
			break;
		}	
	}
}
*/

function checkOpt(src){
	search = /,/;
	res = search.test(src.value);
	if(res == true){
		alert('Sie haben im Branchenfeld eine (rot gekennzeichnete) Oberbranche ausgewählt.\n\rBitte wählen Sie statt dessen eine Unterbranche aus!\n\r\n\rBrans Bölümünde kirmizi ve büyük harfli olan Üst Branslari secmeyiniz.\n\rLütfen bir Alt Brans seciniz.');
			src.selectedIndex=0;
	}
}