var DOM = 0, ALL = 0, LAY = 0;

if(document.getElementById) {
   DOM = 1;
	}
 if(document.all) {
   ALL = 1;
	}
if(document.layers) {
   LAY = 1;
 }
 if(document.all && document.getElementById){
	ALL = 0;
	DOM = 1;
} 

var pics = new Array("img1/i01.jpg", "img1/i02.jpg", "img1/i03.jpg", "img1/i04.jpg", "img1/i05.jpg", "img1/i06.jpg", 
"img1/i07.jpg", "img1/i08.jpg", "img1/i09.jpg", "img1/i10.jpg", "img1/i11.jpg", "img1/i12.jpg", "img1/i13.jpg", 
"img1/i14.jpg", "img1/i15.jpg", "img1/i16.jpg", "img1/i.jpg");

function preload(){
	for(j = 0; j < pics.length; j++){
		eval('img' + j + '= new Image();');
		eval('img' + j + '.src = pics[j];');
	}
}	

var imgDir = "img1/";

function swapsIn(iconsIds){
	var wIcons = swapsIn.arguments.length;
	for(i = 0; i < wIcons; i++){
		iconId = swapsIn.arguments[i];
		wSrcString = iconId + ".jpg";
		if(DOM){
			wIcon = document.getElementById(iconId);
		}
		if(ALL){
			wIcon = eval('document.all.' + iconId);
		}
		if(LAY){
			wIcon = eval('document.icons.document.' + iconId);
		}
		wIcon.src = imgDir + wSrcString;
	}
}

function swapsOut(outlinesIds){
	var wOutlines = swapsOut.arguments.length;
	for(i = 0; i < wOutlines; i++){
		OutlineId = swapsOut.arguments[i];
		OutlineFileNr = OutlineId.slice(1,3);
		wSrcString = "io" + OutlineFileNr + ".jpg";
		if(DOM){
			wOutline = document.getElementById(OutlineId);
		}
		if(ALL){
			wOutline = eval('document.all.' + OutlineId);
		}
		if(LAY){
			wOutline = eval('document.icons.document.' + OutlineId);
		}
		wOutline.src = imgDir + wSrcString;
	}
}

function shapes(wShapes){
	selIconShapeId = shapes.arguments[0];
	if(DOM){
		wShape = document.getElementById(selIconShapeId);
		}
		if(ALL){
		wShape = eval('document.all.' + selIconShapeId);
		}
		if(LAY){
		wShape = eval('document.shape.document.' + selIconShapeId);
		}
	wShape.src = "img1/shape.gif"
}

function noshapes(wShapes){
	shapeId = noshapes.arguments[0]
	if(DOM){
		wShape = document.getElementById(shapeId);
	}
	if(ALL){
		wShape = eval('document.all.' + shapeId);
	}
	if(LAY){
		wShape = eval('document.shape.document.' + shapeId);
	}
	wShape.src = "img1/transpar.gif"
}

function flipPortrait(image){
	wImg = flipPortrait.arguments[0];
	if(DOM){
		document.getElementById("me").src = wImg;
	}
	if(ALL){
		document.all.me.src = wImg;
	}
	if(LAY){
		document.portrait.document.me.src = wImg;
	}
}

function Win(url, name, w, h) {
	winwindow=window.open(url, name,'width=' + w + ',height=' + h + 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
	winwindow.focus();	
}

function Win2(url, name, w, h, l, t) { 
	winwindow2=window.open(url, name,'width=' + w + ',height=' + h + ',left=' + l + ',top=' + t + 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no');
	winwindow2.focus();
}

// to launch a temporary winOpener-window - this will open a maximized content-window and close itself	
function WinNewWin(url, name, w, h) {
	winwindow=window.open(url, name,'width=' + w + ',height=' + h + 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
	winwindow.focus()
}

function waitForSpecial() {
	window.setTimeout("rollSpecial('out')",1800);
}

function rollSpecial(dir) {
	wDir = rollSpecial.arguments[0];
	if(DOM){
		var myStyle = document.getElementById("special").style;
		var myLeft = parseInt(myStyle.left);
	}
	if(LAY) {
		var myStyle = document.special;
		var myLeft = myStyle.left;
	}
	if(ALL) {
		var myStyle = document.all.special;
		var myLeft = parseInt(myStyle.left);
	}
	if(myLeft < 0 && wDir == "in") {
		newLeft = myLeft + 10;
		myStyle.left = newLeft;
		window.setTimeout("rollSpecial('in')",20);
	}
	if(myLeft > -790 && wDir == "out") {
		newLeft = myLeft - 10;
		myStyle.left = newLeft;
		window.setTimeout("rollSpecial('out')",20);
	} 
}
