/* function reDo() { 
 window.location.reload(); 
 } 

window.onresize = reDo; */

//Define global variables
var timerID = null;
var timerOn = false;
var timecount = 1500;
// Change this to the time delay that you desire
var what = null;
var newbrowser = true;
var check = false; 

function init() { 
 if (document.getElementById) { 
 layerRef="document.getElementByID"; 
 styleSwitch=".style"; 
 what="dom1"; 
 } 
 else if(document.all) { 
 layerRef="document.all"; 
 styleSwitch=".style"; 
 what ="ie4"; 
 } 
 else if(document.layers) { 
 layerRef="document.layers"; 
 styleSwitch=""; 
 what ="ns4"; 
 } 
 else { 
 what="none"; 
 newbrowser = false; 
 } 
check = true; 
} 

// Toggles the layer visibility on 
function showLayer(layerName) { 
 document.getElementById(layerName).style.visibility="visible"; 
 }
 
 // Toggles the layer visibility off 
function hideLayer(layerName) { 
 document.getElementById(layerName).style.visibility="hidden"; 
 }
 
 function startTime() { 
 if (timerOn == false) { 
 timerID=setTimeout( "hideAll()" , timecount); 
 timerOn = true; 
 } 
 } 
 
 function stopTime() { 
 if (timerOn) { 
 clearTimeout(timerID); 
 timerID = null; 
 timerOn = false; 
 } 
 } 
 
 function onLoad() { 
 init(); 
 }
 
function showImage(pos) {
	if (isNaN(pos))  // not an index, an actual location
		var bigImg = window.open("/popup.html?"+pos,"text","toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,width=400,height=400,resizable=yes");
	else
		var bigImg = window.open("/popup.html?"+document['imgs'+pos].src.replace('small', 'large'),"text","toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,width=400,height=400,resizable=yes");
};

function popup(pageLoc, pageName,  wide, high) {
	pageName = open(pageLoc, pageName, "width="+wide+",height="+high+",resizeable=no,scrollbars=auto");
}

function openWindow(email) {
	if (email.indexOf(".") < 4 && email.indexOf(".") > email.indexOf("@")){
		alert("You need to provide a valid email address.");
		return false;
	}
	// The locationString will have to change to the actual location of the CGI
	locationString = "http://www.tresorberlin.com/getID.pl?redir=1&email=" + escape(email);
	IDWin = window.open(locationString,"getID","width=400,height=300");
}

function hideAll() { 
	hideLayer('newsLayer');
	hideLayer('collectionLayer');
	hideLayer('companyLayer');
	hideLayer('buyersLayer');
	hideLayer('downloadLayer');
	hideLayer('pressLayer');
	hideLayer('contactsLayer');

} 
