function check(el){

var yoffset=absTop(el)

//y=window.event.clientY
document.getElementById("vakanz").style.visibility = "visible";
document.getElementById("vakanz").style.left = (screen.width-320)/2;
document.getElementById("vakanz").style.top =((yoffset-document.getElementById("vakanz").offsetHeight)-70)
}

function absTop(el) {
       return (el.offsetParent)?
       el.offsetTop+absTop(el.offsetParent) : el.offsetTop;
    }

function remote(url){

	opener.window.location.href=url;
	window.close();

}


function ShowHide(visibility,tagname) {

     document.getElementById(tagname).style.visibility = visibility;
}





function checkDate(){



	var abDatum,abd,abm,aby,bisDatum,bisd,bism,bisy,start,stop,checktime,newstop

	abDatum=document.data_car.abdat.value;
	abd=parseInt(abDatum.substring(0,2),10);
	abm=parseInt(abDatum.substring(3,5),10);
	aby=parseInt(abDatum.substring(6,10),10);

	bisDatum=document.data_car.bisdat.value;
	bisd=parseInt(bisDatum.substring(0,2),10);
	bism=parseInt(bisDatum.substring(3,5),10);
	bisy=parseInt(bisDatum.substring(6,10),10);

	start = new Date(aby,abm-1,abd);
	stop = new Date(bisy,bism-1,bisd);

	abtimestamp=start.getTime();
	bistimestamp=stop.getTime();
	dayval=start.getDay();
	estimatestop=abtimestamp + (document.data_car.dauer.value * 86400000);
	if(stop.getDay()!=6){
		if(estimatestop >= bistimestamp){
				//ShowHide('visible','datalert')
				stop.setTime(estimatestop);
				bistimestamp = estimatestop+((6-stop.getDay())*86400000);
				stop.setTime(bistimestamp);
				var stopY = stop.getFullYear();
				var stopM = stop.getMonth() + 1;
				var stopD = stop.getDate();
				if (stopM < 10)  stopM = "0"+stopM;
				if (stopD < 10)  stopD = "0"+stopD;
				document.data_car.bisdat.value=stopD+'.'+stopM+'.'+stopY;




				//stopwindow()
				//return false;
			}

	}

}




function setDate(differ){

	var sdate= new Date()

	sdate.setTime(sdate.getTime()+(differ*86400000));
	t   = sdate.getDate();
	m   = sdate.getMonth()+1;
	y   = sdate.getFullYear();

	if (t < 10) t= "0"+t;
	if (m < 10) m= "0"+m;

	return t+'.'+m+'.'+y;

}


function initDate(){


document.data_car.abdat.value=setDate(21);
document.data_car.bisdat.value=setDate(28);
focus();


}




function chkform()
{


	if(document.data_car.country.value=='-1'){
		ShowHide('visible','calert')


		return false;
		}
	else if(document.data_car.city.value=='-1'){
		ShowHide('visible','ralert')


		return false;
		}
	else return true;
}






function pause(action,affid){

var waitanim

	if(!waitanim){
		waitanim = window.open(action+'.php?agent='+affid,'wait','noresize,width=330,height=120,left=200,top=200');
	}

}

function stopwindow(){

	waitanim = window.open('stop.htm','wait','noresize,width=300,height=90,left=200,top=200');

}




function opencal(url,inputname){

	dauer='7';
	Datum=document.getElementById(inputname).value;
	d=parseInt(Datum.substring(0,2),10);
	m=parseInt(Datum.substring(3,5),10);
	y=parseInt(Datum.substring(6,10),10);


	url=url+'&monthID='+m+'&yearID='+y+'&dauer='+dauer;

	var top=screen.height;
    var left=screen.width;
    posx=((left/2)-100);
    posy=((top/2)-180);
    calwin = window.open(url,'Kalender','width=290,height=205,scrollbars=no,screenX='+posx+',screenY='+posy+',left='+posx+',top='+posy+'');
    calwin.focus();



}





