// PopUp
	
function popupWindow(URL,width,height,param)
	{
	window.open(URL,"POPUP","width="+width+",height="+height+","+param);
	}

// JavaScript Document

function MM_swapImgRestore() { //v3.0
  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() { //v3.0
  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_findObj(n, d) { //v4.01
  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_swapImage() { //v3.0
  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];}
}


//---------------------------------------------------------------------------------------//
// name:       js-slideShow                                                                                  //
// version:   2.1                                                                                                //
// made by:  melko                                                                                             //
// email: melko@gmx.at                                                                                      //
//                                                                                                                    //
// info:                                                                                                             //
//         this script enables you to use so many slideShows as you want to                //
//         have on your page without any extra-programming.                                    //
//         Only you must do is to set the paths and image-names!                               //
//                                                                                                                     //
// features:                                                                                                       //
//              - so many slideShows as you want to have                                             //
//              - easy implementation in the sourcecode                                              //
//              - each slideShow has its own slideShowSpeed and crossFadeDuration      //
//              - choose between random or in the order                                   //
//              - set a fix picture at the start of a slideShow                           //
//											  //
// important:										  //
//	       - The slideShow MUST be initialized with the same number as the index      //
//                of the images it is containing!! example: images[1] = slideShowNr 1     //
//             - You should never have more slideShows than images defined!!              //
//----------------------------------------------------------------------------------------//

//Specify the global path to the directory
var bigPath="";

// pic arrays! FIRST POSITION IN THE ARRAY is the SMALLPATH to the pictures!
// if you no path want, then set "" !! Images starts allways with 0 !
var images = new Array();
// The FIRST slideShow with slideNr = 0 and so on... 

// HeadSlide "Hotel"
images[0] = ["","images/radl01.jpg","images/radl02.jpg","images/radl03.jpg","images/radl04.jpg","images/radl05.jpg","images/radl06.jpg","images/radl07.jpg"];
images[1] = ["","images/surf01.jpg","images/surf02.jpg","images/surf03.jpg","images/surf04.jpg","images/surf05.jpg","images/surf06.jpg","images/surf07.jpg","images/surf08.jpg","images/surf09.jpg","images/surf10.jpg","images/surf11.jpg","images/surf12.jpg","images/surf13.jpg"];
images[2] = ["","images/golf01.jpg","images/golf02.jpg","images/golf03.jpg","images/golf04.jpg","images/golf05.jpg","images/golf06.jpg","images/golf07.jpg","images/golf08.jpg"];
images[3] = ["","images/ski01.jpg","images/ski02.jpg","images/ski03.jpg","images/ski03.jpg","images/ski04.jpg","images/ski05.jpg","images/ski06.jpg","images/ski07.jpg","images/ski08.jpg"];


// do not edit anything below this line 
//-------------------------------------------------------------------------------------//
var slideSpeed = new Array();
var crossFade = new Array();  
var index = new Array(); 
var pic = new Array(); 
var smallPath = new Array();
var preLoad = new Array(); 

// Initialize the slideShow... 
// @param slideNr - The slideNr of the slideShow... Every slide shoud start with 1
// @param slideShowSpeed - The speed of the slideShow in ms! (1sec. = 1000ms)
// @param crossFadeDuration - The duration of the crossFade (changing one picture through an other) values: 1, 2, 3,...
// @param random - Indicates if the slideShow shoud choose the pictures randomly or in the order. values; true, false
// @param fixStartPic - Indicates if the slideShow, with random = true, should have a fixStart picture at refreshing the page. Its the first image in the array. values: true, false
function init(slideNr, slideShowSpeed, crossFadeDuration, random, fixStartPic) {

index[slideNr] = 0;
slideSpeed[slideNr] = slideShowSpeed;
crossFade[slideNr] = crossFadeDuration;
smallPath[slideNr] = images[slideNr][0];
pic[slideNr] = new Array();
for(var i = 0; i < images[slideNr].length-1; i++){
pic[slideNr][i] = images[slideNr][i+1];
}

prepareSlideSlideSlideSlideSlideSlideSlide(slideNr, fixStartPic, random, pic[slideNr].length);
}

// Prepare the slideShow, set the pictures-order, fixStartPic and load it into PreLoad-Object
// @param slideNr - The slideNr of the slideShow... Every slide shoud start with 1
// @param fixStartPic - Indicates if the slideShow, with random = true, should have a fixStart picture at refreshing the page. Its the first image in the array. values: true, false 
// @param random - Indicates if the slideShow shoud choose the pictures randomly or in the order. values; true, false
// @param picLength - It's the length of the pic-Array of this slideShow
function prepareSlideSlideSlideSlideSlideSlideSlide(slideNr, fixStartPic, random, picLength){
	
	var duplicate = false;
	var reihenfolge = new Array();
	var z=0;
	
	if(fixStartPic){
		reihenfolge[0] = 0;
		z=1;
	}
	
	while (z != picLength){
		y=Math.floor(Math.random()*(picLength));
		for(i=0;i<reihenfolge.length;i++){	
			if (y==reihenfolge[i]){	
				duplicate=true;
			}
		}
		if (duplicate==true){ 
			duplicate=false;
			continue;
		} 
		else if (duplicate==false) { 
			reihenfolge[z] = y; z+=1; 
			
		}
	}
	preLoad[slideNr] = new Array();
	
if(random) {
for(i = 0; i < picLength; i++){
preLoad[slideNr][i] = new Image();
preLoad[slideNr][i].src = bigPath + smallPath[slideNr] + pic[slideNr][reihenfolge[i]];
}
} 
else {
for (i = 0; i < picLength; i++) { 
preLoad[slideNr][i] = new Image(); 
preLoad[slideNr][i].src = bigPath + smallPath[slideNr] + pic[slideNr][i]; 
} 
}
}

// Run the slideShow with the slideNr that indicates the special slide
// @param slideNr - The slideNr of the slideShow... Every slide shoud start with 1
function runSlideShow(slideNr) { 
	var element = document.getElementById("slide"+slideNr);
	
	if (document.all) { 
		element.style.filter='blendTrans(duration='+crossFade[slideNr]+')'
		element.filters.blendTrans.Apply(); 
	} 
	element.src = preLoad[slideNr][index[slideNr]].src; 
	
	if (document.all) { 
		element.filters.blendTrans.Play(); 
	} 
	index[slideNr] += 1; 
	
	if (index[slideNr] > (preLoad[slideNr].length - 1)) {
		index[slideNr] = 0;
	}
	setTimeout('runSlideShow('+slideNr+')', slideSpeed[slideNr]); 
}