var headerHeight = 70;
var footerHeight = 24;

//window.onload = init;
//function init() {}

function setFocus(theId) {
	
	if(document.getElementById(theId)) {
		focusedElement = document.getElementById(theId);
		focusedElement.focus();
	}
	
} // function setFocus()

function changeFormAction() {
	var radShowExcel = document.getElementById('radShowExcel');
	var radShowCSV = document.getElementById('radShowCSV');
	var btnForward = document.getElementById('btnForward');
	var btnText = document.getElementById('btnText');
	var actAction = "";
	
	if (radShowExcel.checked == true && actAction != 'XLSDownload') {
		actAction = document.forms.forSkuSearch.action;
		document.forms.forSkuSearch.action = "XLSDownload";
		//btnForward.disabled = true;
		//btnForward.value = btnText.value;
		document.forms.forSkuSearch.submit();
	}
	else {
		//btnForward.disabled = false;
		document.forms.forSkuSearch.action = actAction;
	}
}

function showLoadingStatus() {
	var submitDiv = document.getElementById('formSubmit');
	submitDiv.style.display = 'none';
	
	var progressDiv = document.getElementById('idProgressBar');
	progressDiv.style.display = 'block';
	
	window.setTimeout("document.getElementById('idProgressAnim').src = 'neutral/layout/loading.gif?1';", 50);

	return true;
}

function checkAllBoxes(formname,checkname,thestate){
	var el_collection=eval("document.forms."+formname+"."+checkname)
	for (c=0;c<el_collection.length;c++)
		el_collection[c].checked=thestate
}

function searchForSku(searchType) {
	var divPictures = document.getElementById('searchSkuOption_pictures');
	var divProducts = document.getElementById('searchSkuOption_products');
	var divChoice = document.getElementById('searchSkuOption_choice');
	var divAvalLang = document.getElementById('avallangid');
	var inpSelect = document.getElementById('skuFor');
	
	if(searchType == 'pictures') {
		divPictures.className = divPictures.className.replace(/hidden/gi, ''); 
		divProducts.className = divProducts.className + ' hidden';
		divChoice.className = divChoice.className.replace(/hidden/gi, ''); 
		divAvalLang.className = divAvalLang.className + ' hidden'; 
		divAvalLang.disabled = 'disabled';
		inpSelect.value = 'pictures';
	}
	else if (searchType == 'products') {
		divPictures.className = divPictures.className + ' hidden';
		divProducts.className = divProducts.className.replace(/hidden/gi, '');
		divChoice.className = divChoice.className + ' hidden'; 
		divAvalLang.className = divAvalLang.className.replace(/hidden/gi, ''); 
		divAvalLang.disabled = null;
		inpSelect.value = 'products';
	}
}

function enableMailBlockHandling (theType, theMode) {
	
	if (document.getElementById('pdfBlock')) {
		var inputArray = document.getElementsByTagName('INPUT');
		for(var i = 0; i < inputArray.length; i++) {
			if(inputArray[i].type == 'radio') {
				inputArray[i].onclick = handleMailBlock;
			}
		}
	}
	
} // function enableMailBlockHandling

function handleMailBlock () {

	var theMode = this.id.substring(this.id.indexOf('_') + 1, this.id.lastIndexOf('_'));
	var theType = this.id.substring(this.id.lastIndexOf('_') + 1, this.id.length);
	var requestetId = 'mailBlock_' + theType;
	var requestetDiv = document.getElementById(requestetId);
	var pseudoId = theType + '_subject';
	var pseudoObject = document.getElementById(pseudoId);
	var inputArray = requestetDiv.getElementsByTagName('INPUT');
	var textareaArray = requestetDiv.getElementsByTagName('TEXTAREA');
	var formObject = document.getElementById('forPDFGenerator_' + theType);

	for(var i = 0; i < inputArray.length; i++) {
		if(inputArray[i].type = 'text') {
			if(theMode == 'download') {
				inputArray[i].disabled = 'disabled';
			} else if(theMode == 'email') {
				inputArray[i].disabled = null;
			}
		}
	}
	for(var j = 0; j < textareaArray.length; j++) {
		if(theMode == 'download') {
			textareaArray[j].disabled = 'disabled';
		} else if(theMode == 'email') {
			textareaArray[j].disabled = null;
		}
	}
	
	if(theMode == 'download') {
		// Email-Block ausblenden
		if(requestetDiv.className.indexOf('hidden') < 0) requestetDiv.className = requestetDiv.className + ' hidden';
		// Hidden-Parameter emailSubject setzen
		pseudoObject.name = 'pseudo';
		pseudoObject.value = '';
		// form target setzen
		formObject.target = '_self';
		// form action setzen
		formObject.action = pdfGeneratorURL_generate;
	} else if(theMode == 'email') {
		// Email-Block einblenden
		if(requestetDiv.className.indexOf('hidden') > -1) requestetDiv.className = requestetDiv.className.replace(/hidden/gi, '');
		// Hidden-Parameter emailSubject setzen
		pseudoObject.name = 'eMailSubject';
		if(theType == 'booklet') {
			pseudoObject.value = eMailSubject_booklet;
		} else if (theType == 'dina4') {
			pseudoObject.value = eMailSubject_dina4;
		}
		// form target setzen
		//formObject.target = '_blank';
		formObject.target = 'winPDFEmail';
		// form action setzen
		formObject.action = pdfGeneratorURL_email;
	}

	if(document.getElementById('scrollPos')) {
		var scrollPos = document.getElementById('scrollPos');
		window.setTimeout ('scrollPos.focus()', 10);
		window.setTimeout ('scrollPos.blur()', 20);
	}

} // function handleMailBlock

function handleSubmit(formName, langTag) {

	var theType = formName.substring(formName.indexOf('_') + 1, formName.length);
	var requestedId = 'mailBlock_' + theType;
	var requestedObject = document.getElementById(requestedId);

	if(requestedObject.className.indexOf('hidden') < 0) {
		var inputArray = requestedObject.getElementsByTagName('INPUT');
		var blocker = false;
		for(var i = 0; i < inputArray.length; i++) {
			var theValue = inputArray[i].value;
			if(inputArray[i].className.indexOf('mandatory') > -1 && (theValue == '' || !isValidMailAddress(theValue))) {
				blocker = true;
				break;
			}
		}
		if (blocker) alert(mandatoryMessage);
		else {
			
			if (theType != 'gallery') {
				newWin = openWindow (langTag + '/program/pdfEmail.htm', 300, 300, 0, 0, 'winPDFEmail', wSetFocus + wDependent, wResizable + wBookmarks + wScrollbars + wMenubar + wToolbar + wStatusbar + wLocationbar);
			}
			
			document.forms[formName].submit();
		}
	} 
	else {
		document.forms[formName].submit();
	}
	
} // function handleSubmit


function submitShowSelection(formName) {
	
	var formElement;
	var ccatIsSet = false;
	if(document.getElementById(formName)) formElement = document.getElementById(formName);
	var inputArray = formElement.getElementsByTagName('INPUT');
	
	for(var i = 0; i < inputArray.length; i++) {
		if(inputArray[i].name == 'ccat_id') {
			if(inputArray[i].type == 'hidden') {
				ccatIsSet = true;
				break;
			} else if(inputArray[i].type == 'checkbox') {
				if(inputArray[i].checked) {
					ccatIsSet = true;
					break;
				}
			}
		}
	}
	
	var hiddenField;
	var theParentElement;
	if(document.getElementById('selectedCcatId')) hiddenField = document.getElementById('selectedCcatId');
	
	if(!ccatIsSet) {
		hiddenField.name = 'ccat_id';
	} else {
		if(document.getElementById('selectedCcatId')) theParentElement = hiddenField.parentNode;
		if(document.getElementById('selectedCcatId')) theParentElement.removeChild(hiddenField);
	}

	document.forms[formName].submit();
	
} // function submitShowSelection


function setParam(pseudoId, pseudoName, pseudoValue) {
	
	var pseudoObj = document.getElementById(pseudoId);
	pseudoObj.name = pseudoName;
	pseudoObj.value = pseudoValue;
	
} // function setParam


function setParamAndSubmit(formName, pseudoId, pseudoName) {
	
	var pseudoObj = document.getElementById(pseudoId);
	pseudoObj.name = pseudoName;
	document.forms[formName].submit();
	
} // function setParamAndSubmit


function isValidMailAddress(theString) {
	
	var result = true;
	var atPos = theString.indexOf('@');
	var atLastPos = theString.lastIndexOf('@');
	var stringAfterAt = theString.substring(atPos + 1, theString.length);
	var dotLastPos = stringAfterAt.lastIndexOf('.');

	if(atPos < 1) result=false; // enthält kein @ mit mindestens einem Zeichen davor
	if(atPos != atLastPos) result=false; // enthält mehr als ein @
	if(stringAfterAt.indexOf('.') < 1) result=false; // // enthält kein . mit mindestens einem Zeichen davor (hinter dem @)
	if(dotLastPos == stringAfterAt.length - 1) result=false; // enthält kein Zeichen mehr hinter dem letzten Punkt
	
	if (result) return true;
	else return false;
	
} // function isValidMailAddress


// Bilddetail-Popup: Produktdetails onclick zu-/aufklappen
function toggleProductAttributeTableByID (theID) {

	var theTable = document.getElementById('productAttributes_' + theID);
	var theLink = document.getElementById('a_' + theID);
	var isOpen = theLink.className.indexOf ('open') > -1;

	if(theTable != null) {

		if (isOpen) {
			theLink.className = theLink.className.replace(/open/gi, '');
		} 
		else {
			theLink.className = theLink.className + ' open';
		}

		theTable.style.display = isOpen ? 'none' : 'block';
		
		if (theLink.getElementsByTagName ('IMG').length > 0) {
			var theArrow = theLink.getElementsByTagName ('IMG')[0];
			if (isOpen) {
				theArrow.src = theArrow.src.replace(/open/gi, 'east');
				theArrow.style.marginLeft = '-2px';
				theArrow.style.paddingLeft = '0px';
				theArrow.width = 10;
				theArrow.height = 12;
			} else {
				theArrow.src = theArrow.src.replace(/east/gi, 'open');
				theArrow.style.marginLeft = '-2px';
				theArrow.style.paddingLeft = '0px';
				theArrow.width = 7;
				theArrow.height = 6;
			}
		}
	}

	
} // function toggleProductAttributeTableByID


function printWindow() {

	if (window.print) {
		window.print();
		return true;
	} else return false;
	
} // function printWindow


function getHeight () {
	
  if (document.body && document.documentElement.clientHeight) {
    return document.documentElement.clientHeight;
  } else {
    return 0;
  }
  
} // function getHeight


function getWidth () {
	
  if (document.body && document.documentElement.clientWidth) {
    return document.documentElement.clientWidth;
  } else {
    return 0;
  }
  
} // function getWidth


function getFFHeight () {
	
  if (window.innerHeight) {
    return window.innerHeight;
  } else {
    return 0;
  }
  
} // function getHeight


function getFFWidth () {
	
  if (window.innerWidth) {
    return window.innerWidth;
  } else {
    return 0;
  }
  
} // function getWidth


function windowResizeHandler () {
	
  if (theHeight != getHeight() || theWidth != getWidth()) recalcDivSize();

} // function windowResizeHandler


function windowFFResizeHandler () {
	
  if (theHeight != getHeight() || theWidth != getWidth()) recalcFFDivSize();

} // function windowResizeHandler


function recalcDivSize (setAutoSizes) {

	var scrollWidth = 42;
	var theDiv = document.getElementById ('iFrame');
	var mainTable;
	var mainDiv;
	var tabs;
	if(document.getElementById ('productDetails') != null) mainTable = document.getElementById ('productDetails');
	if(document.getElementById ('downloadCenter') != null) mainDiv = document.getElementById ('downloadCenter');
	if(document.getElementById ('tabs') != null) tabs = document.getElementById ('tabs');

	var newHeight = getHeight();
	var newDivHeight = newHeight - headerHeight - footerHeight;
	theDiv.style.height = setAutoSizes ? 'auto' : newDivHeight;
	theHeight = newHeight;

	var newWidth = getWidth();
	theDiv.style.width = setAutoSizes ? 'auto' : newWidth;
	if(document.getElementById ('productDetails') != null) mainTable.style.width = setAutoSizes ? '100%' : newWidth - scrollWidth;
	if(document.getElementById ('downloadCenter') != null) mainDiv.style.width = setAutoSizes ? '100%' : newWidth - scrollWidth;
	if(document.getElementById ('tabs') != null) tabs.style.width = setAutoSizes ? '100%' : newWidth - scrollWidth;
	
	theWidth = newWidth;
	
	var zoomTable;
	if(document.getElementById ('zoomTable') != null) {
		zoomTable = document.getElementById ('zoomTable');
		var zoomHeight;
		if((newHeight -150) > 0) {
			zoomHeight = newHeight - 150;
		} else{
			zoomHeight = 1;
		}
		zoomTable.style.height = zoomHeight + 'px';
	}
	
} // function recalcDivSize


function recalcFFDivSize (setAutoSizes) {

	var newHeight = getFFHeight();
	theHeight = newHeight;

	var zoomTable;
	if(document.getElementById ('zoomTable') != null) {
		zoomTable = document.getElementById ('zoomTable');
		var zoomHeight;
		if((newHeight -150) > 0) {
			zoomHeight = newHeight - 150;
		} else{
			zoomHeight = 1;
		}
		zoomTable.style.height = zoomHeight + 'px';
	}
	
} // function recalcDivSize


function printPopup () {
	
	//recalcDivSize (true);
	window.print();
	//recalcDivSize ();
	
} // function printPopup


/*
Workaround für's IE Ladebalkenproblem: Hintergrundbilder in a's - CSS durch Markup ersetzen.
*/

function ieLinkBgWorkaround (theNaviID) {

	var docAnchors = document.getElementsByTagName('A');
	var imgArrow = new Array();

	for (var i=0; i < docAnchors.length; i++) {

		bgImg = docAnchors[i].currentStyle.backgroundImage;
		theClassName = docAnchors[i].className;
		parentClassName = docAnchors[i].parentNode.className;
		parentID = docAnchors[i].parentNode.id;
		grandparentClassName = docAnchors[i].parentNode.parentNode.className;

		if ((bgImg == 'none') || (theClassName == 'topOfPage') || (theClassName == 'closeWindow') || (theClassName == 'printWindow') || (theClassName == 'noWorkaround')) continue;
		
		// Nur in der Navigation der Fall
		if ((docAnchors[i].currentStyle.display == 'block') && (parentClassName != 'link')) {
			var isMainNavi = determineIfMainNavi(docAnchors[i], theNaviID);
			var isPersonalNavi = determineIfMainNavi(docAnchors[i], 'personal');
			var isSearchBox = determineIfMainNavi(docAnchors[i], 'searchBox');
			var isContentNavi = determineIfMainNavi(docAnchors[i], 'contentNavigation');
			if(isMainNavi) {
				imgArrow[i] = document.createElement ('IMG');
				imgArrow[i].src = bgImg.substring (bgImg.indexOf ('"') + 1, bgImg.lastIndexOf ('"') );
				imgArrow[i].style.paddingRight = (imgArrow[i].src.indexOf ('open') > -1) ? '4px' : '7px';
				docAnchors[i].style.textIndent = '-11px';
				docAnchors[i].insertBefore (imgArrow[i], docAnchors[i].firstChild);
				docAnchors[i].style.backgroundImage = 'none';
			} else if(isPersonalNavi || isSearchBox || isContentNavi) {
				imgArrow[i] = document.createElement ('IMG');
				imgArrow[i].src = bgImg.substring (bgImg.indexOf ('"') + 1, bgImg.lastIndexOf ('"') );
				imgArrow[i].style.paddingRight = '1px';
				docAnchors[i].style.textIndent = '-11px';
				docAnchors[i].insertBefore (imgArrow[i], docAnchors[i].firstChild);
				docAnchors[i].style.backgroundImage = 'none';
			} 
		} else {
			// externer Link
			if(parentClassName.indexOf ('externalLink') > -1) {
				imgArrow[i] = document.createElement ('IMG');
				imgArrow[i].src = bgImg.substring (bgImg.indexOf ('"') + 1, bgImg.lastIndexOf ('"') );
				if(docAnchors[i].className == 'open') {
					docAnchors[i].style.marginLeft = '0px';
					imgArrow[i].style.paddingRight = '3px';
					docAnchors[i].style.paddingLeft = '0px';
				} else {
					docAnchors[i].style.marginLeft = '-2px';
					docAnchors[i].style.paddingLeft = '0px';
				}
				docAnchors[i].insertBefore (imgArrow[i], docAnchors[i].firstChild);
				docAnchors[i].style.backgroundImage = 'none';
			// Detaillink oder Logoutlink
			} else if (parentClassName == 'link' || parentID == 'darkDetailHeader' || grandparentClassName == 'formRow' || parentClassName == 'formSubmit' || parentClassName.indexOf ('standardlink') > -1) {
				imgArrow[i] = document.createElement ('IMG');
				imgArrow[i].src = bgImg.substring (bgImg.indexOf ('"') + 1, bgImg.lastIndexOf ('"') );
				docAnchors[i].style.margin = '0';
				docAnchors[i].style.paddingLeft = '10px';
				docAnchors[i].style.textIndent = '-10px';
				docAnchors[i].insertBefore (imgArrow[i], docAnchors[i].firstChild);
				docAnchors[i].style.backgroundImage = 'none';
			} 
			// Galerielinks
			else if (parentClassName.indexOf ('stdLink') > -1) {
				imgArrow[i] = document.createElement ('IMG');
				imgArrow[i].src = bgImg.substring (bgImg.indexOf ('"') + 1, bgImg.lastIndexOf ('"') );
				docAnchors[i].style.textIndent = '-12px';
				if(docAnchors[i].target) {
					docAnchors[i].style.paddingLeft = '0px';
					docAnchors[i].style.marginLeft = '-2px';
				}
				docAnchors[i].insertBefore (imgArrow[i], docAnchors[i].firstChild);
				docAnchors[i].style.backgroundImage = 'none';
			}
			// Miniaturlinks
			else if (parentClassName.indexOf ('miniLink') > -1) {
				imgArrow[i] = document.createElement ('IMG');
				imgArrow[i].src = bgImg.substring (bgImg.indexOf ('"') + 1, bgImg.lastIndexOf ('"') );
				if(docAnchors[i].target) {
					docAnchors[i].style.paddingLeft = '0px';
					docAnchors[i].style.marginLeft = '-2px';
				} else {
					docAnchors[i].style.paddingLeft = '8px';
					docAnchors[i].style.textIndent = '-9px';
					docAnchors[i].style.marginLeft = '-1px';
				}
				docAnchors[i].insertBefore (imgArrow[i], docAnchors[i].firstChild);
				docAnchors[i].style.backgroundImage = 'none';
			}
		}
	}
	
} // function ieLinkBgWorkaround


function buildHoverEffect(theNaviID) {

	var pArray = document.getElementsByTagName('P');
	for (var i=0; i < pArray.length; i++) {
		var isMainNavi = determineIfMainNavi(pArray[i], theNaviID);
		if(isMainNavi) {
			pArray[i].onmouseover = paintHover;
			pArray[i].onmouseout = clearHover;
		}
	}
	
} // function buildHoverEffect


function determineIfMainNavi(theObject, theNaviID) {
	
	var theParentNode = theObject.parentNode;
	
	if(theParentNode.nodeName == 'DIV') {
		if(theParentNode.id == theNaviID) {
			return true;
		} else {
			return false;
		}
	} else {
		return determineIfMainNavi(theParentNode, theNaviID);
	}
	
} // function determineIfMainNavi


function paintHover() {
	
	this.className = this.className + ' hovered';
	
} // function paintHover


function clearHover() {
	
	this.className = this.className.replace(/hovered/gi, '');
	
} // function clearHover


function handleEnabling(parDeliveryType) {

	//if (document.getElementById('addressForm') && document.getElementById('deliveryBlock')) {
		
		var basketForm, isdninput, emailinput, zipinput, pseudo1, delivery_type;

		if ((parDeliveryType != null) && (parDeliveryType.length > 0)) delivery_type = parDeliveryType;
		else {
			if(document.location.href.indexOf('delivery_type=') > -1) {
				var startPos = document.location.href.indexOf('delivery_type=') + 14;
				var restString = document.location.href.substring(startPos, document.location.href.length);
				if (restString.length > 0) {
					if(restString.indexOf('&') > -1) {
						delivery_type = restString.substring(0, restString.indexOf('&'));
					} else delivery_type = restString;
				}
				else delivery_type = defaultDeliveryType;
			}
			else delivery_type = defaultDeliveryType;
		}

		basketForm = document.getElementById ('forForm');
		if(document.getElementById('isdninput')) isdninput = document.getElementById ('isdninput');
		if(document.getElementById('emailinput')) emailinput = document.getElementById ('emailinput');
		if(document.getElementById('zipinput')) zipinput = document.getElementById ('zipinput');

		if(delivery_type == 'cd') {
			if(document.getElementById('isdninput')) isdninput.disabled = 'disabled';
			if(document.getElementById('emailinput')) emailinput.disabled = 'disabled';
			if(document.getElementById('zipinput')) zipinput.disabled = 'disabled';
			if(document.getElementById('isdninput')) isdninput.value = '';
			if(document.getElementById('emailinput')) emailinput.value = '';
			if(document.getElementById('zipinput')) zipinput.value = '';
			if(document.getElementById('isdninput') && isdninput.className.indexOf('disabled') < 0) isdninput.className = isdninput.className + ' disabled';
			if(document.getElementById('emailinput') && emailinput.className.indexOf('disabled') < 0) emailinput.className = emailinput.className + ' disabled';
			if(document.getElementById('zipinput') && zipinput.className.indexOf('disabled') < 0) zipinput.className = zipinput.className + ' disabled';
		}
		if(delivery_type == 'zip') {
			if(document.getElementById('zipinput')) zipinput.disabled = null;
			if(document.getElementById('zipinput')) {
				zipinput.className = zipinput.className.replace(/ disabled/gi, '');
			}
			if(document.getElementById('isdninput')) isdninput.disabled = 'disabled';
			if(document.getElementById('emailinput')) emailinput.disabled = 'disabled';
			if(document.getElementById('isdninput')) isdninput.value = '';
			if(document.getElementById('emailinput')) emailinput.value = '';
			if(document.getElementById('isdninput') && isdninput.className.indexOf('disabled') < 0) isdninput.className = isdninput.className + ' disabled';
			if(document.getElementById('emailinput') && emailinput.className.indexOf('disabled') < 0) emailinput.className = emailinput.className + ' disabled';
			pseudo1 = basketForm.pseudo1;
			pseudo1.value = 'zip';
			pseudo1.name = 'basket_user_deliverytype';
		}
		if(delivery_type == 'isdn') {
			if(document.getElementById('isdninput')) isdninput.disabled = null;
			if(document.getElementById('isdninput')) {
				isdninput.className = isdninput.className.replace(/ disabled/gi, '');
			}
			if(document.getElementById('emailinput')) emailinput.disabled = 'disabled';
			if(document.getElementById('emailinput')) emailinput.value = '';
			if(document.getElementById('emailinput') && emailinput.className.indexOf('disabled') < 0) emailinput.className = emailinput.className + ' disabled';
			if(document.getElementById('zipinput')) zipinput.disabled = 'disabled';
			if(document.getElementById('zipinput')) zipinput.value = '';
			if(document.getElementById('zipinput') && zipinput.className.indexOf('disabled') < 0) zipinput.className = zipinput.className + ' disabled';
		}
		if(delivery_type == 'email') {
			if(document.getElementById('emailinput')) emailinput.disabled = null;
			if(document.getElementById('emailinput')) {
				emailinput.className = emailinput.className.replace(/ disabled/gi, '');
			}
			if(document.getElementById('isdninput')) isdninput.disabled = 'disabled';
			if(document.getElementById('isdninput')) isdninput.value = '';
			if(document.getElementById('isdninput') && isdninput.className.indexOf('disabled') < 0) isdninput.className = isdninput.className + ' disabled';
			if(document.getElementById('zipinput')) zipinput.disabled = 'disabled';
			if(document.getElementById('zipinput')) zipinput.value = '';
			if(document.getElementById('zipinput') && zipinput.className.indexOf('disabled') < 0) zipinput.className = zipinput.className + ' disabled';
		}
		
	//}	

} // function handleEnabling


/*
function showHint (layer) {
	LayerWidth = 200;
	//Positionierung des Layers
	obj = document.getElementById(layer);
	obj.style.visibility = 'hidden';
	browser=navigator.appName;
	if( typeof( window.innerWidth ) == 'number' ) {
	   //Non-IE
    winWidth = window.innerWidth;
    leftPosition = (winWidth)/2-LayerWidth+40;
		obj.style.left = leftPosition + 'px';
	} 
	else {
		if (browser=="Microsoft Internet Explorer") {
      //IE 6+ in 'standards compliant mode'
	   winWidth = document.body.clientWidth;
	    leftPosition = (winWidth)/2-LayerWidth+40;
			obj.style.left = leftPosition + 'px';
   	} 
		else {
	  	if (browser=="Netscape") {
	      //IE 4 compatible
		    winWidth = document.body.clientWidth;
		    leftPosition = (winWidth)/2-LayerWidth+40;
				obj.style.left = leftPosition + 'px';
   		}
		}
	}
	obj.style.visibility = 'visible';
	}	

	function hideHint (layer) {
		document.getElementById(layer).style.visibility="hidden";
	}
	
function loadFile (file){ 
 var req = (window.XMLHttpRequest)?new XMLHttpRequest():((window.ActiveXObject) ?new ActiveXObject("Microsoft.XMLHTTP"):false);
 req.open("GET",file,true); 
 req.onreadystatechange = function(){ 
   if(req.readyState == 0){ 
   }else if(req.readyState == 1){ 
   }else if(req.readyState == 2){ 
   }else if(req.readyState == 3){ 
   }else if(req.readyState == 4){ 
     if(req.status == 200 || req.status == "OK"){
       hideHint ('layerHint3');
     }else{
       alert("ERROR: "+req.statusText); 
     } 
   } 
 }
 req.send(null);
}
*/

function setTimeoutHiddenField()
{
    document.getElementById('timeout').value = "expired";	
}
