function popupRacespecial(imagename) {
	window.open('index.php?id=1463&racingpic='+imagename+'','KTMRacing','width=700,height=410,scrollbars=no');
}
function popupxchange(imagename) {
	window.open('index.php?id=1463&xchangepic='+imagename+'','KTMXChange','width=700,height=410,scrollbars=no');
}
function popupTourspecial(imagename) {
	window.open('index.php?id=6742&tourpic='+imagename,'KTMTours','width=700,height=410,scrollbars=no');
}
function popupProductspecials(imagename) {
	window.open('index.php?id=248&productspecialsID='+imagename+'','Productspecials','width=700,height=410,scrollbars=no');
}

function popupTravelspecial(imagename) {
	window.open('index.php?id=6750&travelID='+imagename+'','Travelspecials','width=700,height=410,scrollbars=no');
}

function popupFeaturebox(linkname,windowname,parameters) {
	window.open(linkname,windowname,parameters);
}
function tellafriend_old(tipp, type){
	window.open('tell-a-friend.100316.'+type+'.html?tipp='+tipp,'tellafriend','width=570,height=580,scrollbars=no,toolbar=no,location=no,status=no');	
}
function MM_swapImgRestore() {
  	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() {
  	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() {
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function MM_findObj(n, d) {
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() {
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	obj.visibility=v; }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

wmtt = null;
/*var mousepos = new Array();
document.onmousemove = function (ev)
{
 mousepos = new Array(ev.pageX,ev.pageY);
}
*/
function updateWMTT(e) {
	if (document.all) {
	    x = window.event.x + document.body.scrollLeft;
    	y = window.event.y + document.body.scrollTop;
	} else {
		x = mousepos[0];
		y = mousepos[1];
	}
    if (wmtt!=null) {
    wmtt.style.left = (x + 15) + "px";
    wmtt.style.top 	= (y + 15) + "px";
    }
}

function updateWMTT_tour(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
	if (wmtt != null) {
    wmtt.style.left = (x - 275) + "px";
    wmtt.style.top 	= (y - 15) + "px";
    }
}

function showWMTT(id) {
    wmtt = document.getElementById(id);
    wmtt.style.display = "block"
}

function hideWMTT() {
	wmtt.style.display = "none";
}

function dankeresult(vid,cr_counter1) {
	//alert(estop);	
	var vid1 = vid;
	if (cr_counter1 > 0) {
		cr_counter1 --;
		setTimeout("dankeresult("+vid+",0)",3000);
	} else {
		danke = document.getElementById('danke'+vid);
		danke.style.display = "none";
		ergebnis  = document.getElementById('results'+vid);
		ergebnis.style.display = "block";
		text  = document.getElementById('text'+vid);
		text.style.display = "block";
	}
}

function showevent(uid){
	baba = document.getElementById('terrow'+uid);
	baba.style.display = "none";
	detailinfo = document.getElementById('terrow2_'+uid);
	detailinfo.style.display = "";
}
function hideevent(uid){
	baba = document.getElementById('terrow2_'+uid);
	baba.style.display = "none";
	detailinfo = document.getElementById('terrow'+uid);
	detailinfo.style.display = "";
}
function cr_zoom(pic){
	scroll(0,0);
	d = document;
	d.getElementById('blacklayer').style.display = '';
	d.getElementById('zoomlayer').style.display = '';
	d.getElementById('zoompic').src = pic;
	//Effect.Appear("zoomlayer", {duration: 1});
}
function cr_zoomout(){
	d = document;
	d.getElementById('blacklayer').style.display = 'none';
	d.getElementById('zoomlayer').style.display = 'none';
	d.getElementById('zoompic').src = 'clear.gif';
}

function cr_print(){
	d = document;
	if(d.getElementById('printform')){
		document.printform.submit();
	}else{
		document.printformc.submit();
	}
}

function cr_checkchilli(nr){
	d = document;
	//alert(d.getElementById('level'+nr).checked)
	if(d.getElementById('level'+nr).checked == false){
		d.getElementById('chilli'+nr).src = 'fileadmin/images/tours/chili/chilli'+nr+'_high.gif';
	}else{
		d.getElementById('chilli'+nr).src = 'fileadmin/images/tours/chili/chilli'+nr+'.gif';
	}
}
function cr_selectchilli(nr){
	d = document;
	//alert(d.getElementById('level'+nr).checked)
	if(d.getElementById('level'+nr).checked == false){
		d.getElementById('level'+nr).checked = true;
		d.getElementById('chilli'+nr).src = 'fileadmin/images/tours/chili/chilli'+nr+'_high.gif';
	}else{
		d.getElementById('level'+nr).checked = false;
		d.getElementById('chilli'+nr).src = 'fileadmin/images/tours/chili/chilli'+nr+'.gif';
	}
}
function cr_popstart(){
	setTimeout("cr_popstart1()",500);
}
function cr_popstart1(){
	scroll(0,0);
	d = document;
	d.getElementById('blacklayer').style.display = '';
	d.getElementById('startpopup').style.display = '';
	//Effect.Appear("zoomlayer", {duration: 1});
}

function cr_popout(){
	d = document;
	d.getElementById('blacklayer').style.display = 'none';
	d.getElementById('startpopup').style.display = 'none';

}
function setcookie(name, value, days, path, domain, secure) { 
 var expires = -1; 
 if(typeof days == "number" && days >= 0) {
  var d = new Date(); d.setTime(d.getTime()+(days*24*60*60*1000)); expires = d.toGMTString(); 
 } 
 value = escape(value); 
 document.cookie = name + "=" + value + ";" + (expires != -1 ? " expires=" + expires + ";" : "") + (path ? "path=" + path : "") + (   domain ? "; domain=" + domain : "") + (secure ? "; secure" : ""); 
}

 function cr_undAUS(name,uid){
	 cr_popout();
	 setcookie(name, uid, 7);
 }