

	function blockVisibility(id) {
		var elem = document.getElementById(id);
		if (elem && elem.style) {
			elem.style.display = elem.style.display = 'block';
		}
	}

    function inlineVisibility(id) {
		var elem = document.getElementById(id);
		if (elem && elem.style) {
			elem.style.display = elem.style.display = 'inline';
		}
	}

	function noneVisibility(id) {
		var elem = document.getElementById(id);
		if (elem && elem.style) {
			elem.style.display = elem.style.display = 'none';
		}
	}	
			
	function showDiv(divname){
		blockVisibility(divname);	
	}

	function showDivs(indexArray){
		for (i=0;i<indexArray.length;i++){  
			blockVisibility(indexArray[i]);	
		}
	}

	function closeDiv(divname){
		noneVisibility(divname);
	}

	function closeDivs(indexArray){
		for (i=0;i<indexArray.length;i++){  
			noneVisibility(indexArray[i]);
		}
	}
	function checkLength( node, length ){
		if( node.value.length < length ){
			return true;
		}
		node.value = node.value.substring(0, node.value.length - 1);
		return false;
	}
	
	function toggleVisibilityLink(id, link, closedClass, openClass) {
		var elem = document.getElementById(id);
		if (elem && elem.style) {
			if (elem.style.display == 'none'){
				elem.style.display = 'block';
				if(link!=null){
					link.className=openClass;
				}
				//eval('document.dynamisk_bild'+nr+'.src=iconSynlig');
			}else{
				elem.style.display = 'none';
				if(link!=null){
					link.className=closedClass;
				}
			}
		}
	}

    // Functions to be used with the 2-column, liquid layout with header and footer or
    // 2-column, fixed-width layout with header and footer at http://www.searchenginefriendlylayouts.com.
    // This code may be freely distributed and used in any commercial or non-commercial application, as long as
    // these comments are maintained.  All other comments may be removed.

    function clearOld (absoluteDivName) {
        // hides a div and absolutely positions it outside of the viewable area of the page.
        var absoluteDiv = document.getElementById(absoluteDivName);
        absoluteDiv.style.visibility = 'hidden';
        absoluteDiv.style.overflow = 'hidden';
        absoluteDiv.style.display = 'none';
        absoluteDiv.style.top = '-2px';
        absoluteDiv.style.left = '-2px';
        absoluteDiv.style.width = '1px';
        absoluteDiv.style.height = '1px';
    }

    function replaceDivs(floatDivId, absoluteDivId, floatDivIdBG, floatDivIdBGColor) {
        // This function replaces the contents of the floating div with the contents of the absolutely positioned div.
        var floatDiv = document.getElementById(floatDivId);
        var absoluteDiv = document.getElementById(absoluteDivId);
        var leftHTML = absoluteDiv.innerHTML;
        floatDiv.innerHTML = leftHTML;
        // clear the inner HTML of the absolutely positioned div and hide it to be safe.
        absoluteDiv.innerHTML = null;
        clearOld (absoluteDivId);
        // assign background and background color to the floating div.
        var bgStyle = 'URL(' + floatDivIdBG + ') top left repeat-y ' + floatDivIdBGColor;
        floatDiv.style.background = bgStyle;
    }

    /////////////////////////

    function highlightOn(elname) {
        document.getElementById(elname).style.border = '1px solid #999999';
    }

    function highlightOff(elname) {
        document.getElementById(elname).style.border = '1px solid #ffffff';
    }

    function quickBidding(elname) {
        var el = document.getElementById(elname);
        el.style.top = '-10px';
        el.style.left = '-10px';
        el.height = el.height + 20;
        el.width = el.width + 100;
        
    }


