//if the frameset isn't the parent redirect to index
	if(top.frames.length != 3) top.location = 'index.html';

//browsers
	ie5 = (document.all && document.getElementById);
	ns4 = (!document.all && !document.getElementById);
	ns6 = (!document.all && document.getElementById);
	
//function which returns the right object for the client's browser	
	function Elem(objectID){
		if(ie5) return eval('document.all.' + objectID);
		if(ns6) return document.getElementById(objectID);
		if(ns4) return eval('document.' + objectID);
	}
	
//function for displaying border around thumbnails
	function Thumbnail(object, state){
		if(state) object.style.borderColor = '#666666';
		else object.style.borderColor = '#000000'
	}
	
//the layer for displaying data about the item is invisible at first
	function HideL(){
		if(obj = Elem('item')) obj.style.visibility = 'hidden';
	}	
	
//function for displaying data about the items
	function Show(id){
	
		if(id){		
			large = '_images/pixel.gif';
			description = '';
			price = '';
			
			for(i=0; i<data.length; i++){
				if(data[i][0] == id){
					large = imgPath + id + '.jpg';
					description = data[i][1];
					price = data[i][2] + '€';
				}
			}
		}
		
		container = Elem('item');
		
		iimage = Elem('itemimage');
		iname = Elem('itemname');
		idescription = Elem('itemdescription');
		iprice = Elem('itemprice');
		iorder = Elem('itemorder');

		if(id){
			iimage.src = large;
			iname.innerHTML = id;
			idescription.innerHTML = description;
			iprice.innerHTML = price;
			iorder.value = id;
		}
		else{
			iimage.src = '_images/pixel.gif';
			iname.innerHTML = '';
			idescription.innerHTML = '';
			iprice.innerHTML = '';
			iorder.value = '';
		}
		
		if(ie5){
			sl = top.bottom.document.all.left;
			sr = top.bottom.document.all.right;
			leftpos = document.body.scrollLeft;
		}
		if(ns4){
			sl = top.bottom.document.left;
			sr = top.bottom.document.right;
			leftpos = window.pageXOffset;
		}
		if(ns6){
			sl = top.bottom.document.getElementById('left');
			sr = top.bottom.document.getElementById('right');
			leftpos = window.pageXOffset;
		}
		
		if(container.style.visibility == 'hidden'){
			container.style.left = leftpos + 'px';
			container.style.visibility = 'visible';
			sl.style.visibility = 'hidden';
			sr.style.visibility = 'hidden';
		}
		else{
			container.style.visibility = 'hidden';
			sl.style.visibility = 'visible';
			sr.style.visibility = 'visible';
		}
	}
	
//function for redirecting to the order form
	function Order(spage){
	
		if(ie5){
			sl = top.bottom.document.all.left;
			sr = top.bottom.document.all.right;
		}
		if(ns4){
			sl = top.bottom.document.left;
			sr = top.bottom.document.right;
		}
		if(ns6){
			sl = top.bottom.document.getElementById('left');
			sr = top.bottom.document.getElementById('right');
		}
		
		sl.style.visibility = 'visible';
		sr.style.visibility = 'visible';
		
		iorder = Elem('itemorder');
		id = iorder.value;
		window.location = 'order.php?ID=' + id + '&SP=' + spage;
	}
