var is_ie6 = (navigator.userAgent.toLowerCase().indexOf("msie 6") > -1)?true:false;
var userAgent				= navigator.userAgent.toLowerCase();
var is_ie					= (userAgent.indexOf("msie") > -1)?true:false;
var site = null;
var siteleft = 0;
var sitetop = 0;

var scrollerMainText		= null;
var scrollerCount       = 0;
var arrScrollers			= new Array();

var divImageNoteTextMaxHeight = 0;
var imageListIndex = 0;
var imageTextsArray = null;
var imageSrcArray = null;

document.onmouseup = function()
{
	for(i = 0, len = arrScrollers.length; i < len; i++)
	{
		obj = arrScrollers[i];
		if (obj != null && typeof(obj) != "undefined")
		{
			obj.cancelScroll();
			obj.endDrag();
			obj.alterSpeed(0);
			obj.moving = false;
		}
	}
};

function setup_global()
{
	initialize();
}

function initialize()
{
    if(window.captureEvents){
		window.onmousemove=sourceCheck;
	} else {
		document.onmousemove=sourceCheck;
	}
	if (window.location.href.toLowerCase().indexOf("print.asp")  > -1 ) return;

	//Setup image texts and sources
	imageTextsArray = imageListTexts.substring(1,imageListTexts.length-2).split("','");
	imageSrcArray = imageListImages.substring(0, imageListImages.length -1).split(',');

	site = g("divSite");
	if (blnFirstRun) nextImage();
	reposition();
	divImageNoteTextMaxHeight = crf*400; resizeTextDiv();
	setupLayout();
	setupContents();
	addPngFix();
}

function reposition()
{
	siteleft = ( pageWidth / 2)  - (site.offsetWidth / 2);
	sitetop  = ( pageHeight / 2) - (site.offsetHeight / 2) ; //- (boxbreadcrumb.offsetHeight / 2)
	site.style.left = ( (siteleft > 0)?siteleft :0 ) + "px";
	site.style.top  = ( (sitetop  > 0)?sitetop-2:0 ) + "px";
}

function addPngFix()
{
	if (navigator.userAgent.toLowerCase().indexOf("msie 7") > -1) return;
	pngimg = document.getElementsByTagName("img");
	for(var i = 0, len = pngimg.length; i < len; i++)
	{
		if (pngimg[i].src.toLowerCase().indexOf(".png") > -1)
		{
			pngimg[i].className += " overlay";
		}
	}
}

function createLine(X,Y,W,H,bgcolor,zindex,line_id)
{
	var line = null;
	var is_new_line = (document.getElementById(line_id) == null);
	if (is_new_line)
	{
		line = document.createElement("img");
		line.setAttribute("id", line_id);
		line.setAttribute("src", "gfx/space.gif");
		line.style.position = "absolute";
		document.body.appendChild(line);
	} else {
		line = document.getElementById(line_id);
	}
	line.style.left = ((X)?X:1) + "px";
	line.style.top = ((Y)?Y:1) + "px";
	line.style.width  = ((W)?W:1) + "px";
	line.style.height = ((H)?H:1) + "px";
	line.style.backgroundColor = ((bgcolor)?bgcolor:'#000000');
	if (zindex) line.style.zIndex = zindex;
}

function resValue(r0,r1,r2)
{
	if (jsres == 0)
	{
		return r0;
	} else {
		if (jsres == 1)
		{
			return r1;
		} else {
			return r2;
		}
	}
}

function setFocusInput(obj) { obj = (typeof(obj) == "string")?g(obj):obj; if (obj != null) obj.focus(); }

function right(obj) {  obj = (typeof(obj) == "string")?g(obj):obj; return rxpos(obj.id) + obj.offsetWidth; }

function bottom(obj) { obj = (typeof(obj) == "string")?g(obj):obj; return rypos(obj.id) + obj.offsetHeight; }

function centerVert(objToCenter, objCenterTo)
{
	objCenterTo = (typeof(objCenterTo) == "string")?g(objCenterTo):objCenterTo;
	objToCenter = (typeof(objToCenter) == "string")?g(objToCenter):objToCenter;
	return (rypos(objCenterTo.id) + objCenterTo.offsetHeight / 2) - (objToCenter.offsetHeight /2);
}

function centerHori(objToCenter,objCenterTo)
{
	objCenterTo = (typeof(objCenterTo) == "string")?g(objCenterTo):objCenterTo;
	objToCenter = (typeof(objToCenter) == "string")?g(objToCenter):objToCenter;
	return (rypos(objCenterTo.id) + objCenterTo.offsetWidth / 2) - (objToCenter.offsetWidht /2);
}

var intDivImageNoteTopHidden = 0;
function setupLayout()
{
  g("divTopLogo").style.left = rxpos("divSite")+ 1 + "px";
	g("divTopLogo").style.top  = rypos("divSite")+ 1 + "px";
	
	var extraHomePrintOffset = 0;
	if(jsres == 0)
	{
		extraHomePrintOffset = 1;
	}
	if(g("divHomePrint"))
	{
		g("divHomePrint").style.left = rxpos("divSite") + crf * 753 + extraHomePrintOffset + "px";
		g("divHomePrint").style.top  = rypos("divSite") + crf * 4 + extraHomePrintOffset + "px";
	}
	
	if(g("imgLogoOverlay"))
	{
	    g("imgLogoOverlay").style.left = rxpos("divSite") + crf * 40 + extraHomePrintOffset + "px";
		g("imgLogoOverlay").style.top  = rypos("divSite") + crf * 8 + extraHomePrintOffset + "px";
	}
	
		if(g("divAddThis")){		
	// Øverst til højre:
		//g("divAddThis").style.left = rxpos("divSite") + g("divSite").offsetWidth - g("divAddThis").offsetWidth - crf * 10 + "px";
		//g("divAddThis").style.top  = rypos("divSite") + crf * 172 + "px";
	
	// Øverst til venstre:
		g("divAddThis").style.left = rxpos("divSite") + crf * 9 + "px";
		g("divAddThis").style.top  = rypos("divSite") + crf * 172 + "px";	
		
	// Nederst til venstre:
		//g("divAddThis").style.left = rxpos("divSite") + crf * 10 + "px";
		//g("divAddThis").style.top  = rypos("divSite") + crf * 820 + "px";				
	}
	
	if(g("LangSelection"))
	{
	    g("LangSelection").style.left = rxpos("divSite") + g("divSite").offsetWidth - g("LangSelection").offsetWidth - 1 + "px";
	    g("LangSelection").style.top  = rypos("divSite") + crf * 1 + "px";
	}
	
	if(g("divMenu1TopBackground"))
	{
			g("divMenu1TopBackground").style.left = rxpos("divSite") + g("divSite").offsetWidth - g("divMenu1TopBackground").offsetWidth - 1 + "px";
	    g("divMenu1TopBackground").style.top  = rypos("divSite") + crf * 1 + "px";
	}

	/*
	g("divHomePrint").style.left = rxpos("divSite")+ 1 + g("divTopLogo").offsetWidth - g("divHomePrint").offsetWidth - crf * 10 + "px";
	g("divHomePrint").style.top  = rypos("divSite")+ 1 + crf * 5 + "px";
	*/
	
	var extraOffset = 0;
	if( strTopImageBorderColor.length == 0)
		extraOffset = resValue(4,2,1);
	
	g("divTopImages").style.left = rxpos("divSite")+ 1 + resValue(521,654,819) + extraOffset + "px"; //"524,105|655,131|819,164"
	//g("divTopImages").style.left = rxpos("divSite")+ 1 + resValue(998-831,1248-1039,1560-1299) + "px"; /*,105|,131|1299,164"*/
	g("divTopImages").style.top  = rypos("divSite")+ 1 + "px";
	
	g("divMenu1Background").style.left = rxpos("divSite")+ 1 + "px";
	g("divMenu1Background").style.top  = rypos("divSite")+ 1 + g("divTopLogo").offsetHeight + "px";
	
	g("divMenu1").style.left = rxpos("divSite") + crf*242 + 1 + "px"; //TODO...REDO OFFSET TO 3 HARDCODED VALUES.
	g("divMenu1").style.left = rxpos("divSite") + resValue(155,194,242) + 1 + "px";
	g("divMenu1").style.top  = rypos("divSite")+ 1 + 1+ g("divTopLogo").offsetHeight + "px";
	
	if(g("divMenu2"))
	{
	    g("divMenu2").style.left = rxpos("divSite")+ 1 + "px";
	    g("divMenu2").style.top  = rypos("divMenu1Background") + g("divMenu1Background").offsetHeight + "px";
	    
	    g("divMenu2Container").style.left = 0 + "px";
	    g("divMenu2Container").style.top = crf*45 + "px";
	    
	    //g("divMenu2Text").style.marginTop = crf*45 + "px";
	}//if
	
	if(g("divMenu2"))
	    g("divContents").style.left = rxpos("divMenu2") + g("divMenu2").offsetWidth +"px";
	else
	    g("divContents").style.left = rxpos("divSite")+ 1 + "px";
	
	g("divContents").style.top = rypos("divMenu1Background") + g("divMenu1Background").offsetHeight + "px";
	
	g("divBottomField").style.left = rxpos("divSite")+ 1 + "px";
	g("divBottomField").style.top  = rypos("divContents")+ g("divContents").offsetHeight + "px";
	
	g("divBottomFieldLeftText").style.left = rxpos("divBottomField") + 25 + "px";
	g("divBottomFieldLeftText").style.top = rypos("divBottomField") +1+ "px";
	
	if(g("divBottomFieldRightText"))
	{
		g("divBottomFieldRightText").style.left = rxpos("divBottomField") + g("divBottomFieldLeftText").offsetWidth +"px";
		g("divBottomFieldRightText").style.top = rypos("divBottomField") +1+ "px";
	}
	
	//Set menu2 scroll arrows
	if(g("imgMenu2UpArrow") && g("imgMenu2DownArrow"))
	{
	    //Check if menu2 scroll arrows are needed
	    if( g("divMenu2Text").offsetHeight > g("divMenu2Container").offsetHeight)
	    {
	        g("imgMenu2UpArrow").style.top =  crf*40 - g("imgMenu2UpArrow").offsetHeight + "px"
	        g("imgMenu2UpArrow").style.left = g("divMenu2").offsetWidth/2 - g("imgMenu2UpArrow").offsetWidth/2 + "px";

	        g("imgMenu2DownArrow").style.top =  crf*45 + g("divMenu2Container").offsetHeight + 5 + "px";
	        g("imgMenu2DownArrow").style.left = g("divMenu2").offsetWidth/2 - g("imgMenu2UpArrow").offsetWidth/2 + "px";
	        
	        //check if selected item is below visible area
	        
	        var selectedMenu2ItemList = getElementsByClass('menu2seltd', g("divMenu2Text"), null);
	        if(selectedMenu2ItemList.length > 0)
	        {
	            var selectedMenu2Item = selectedMenu2ItemList[0];
	            var selectedElementOffset = rypos(selectedMenu2Item.id) - rypos("divMenu2Text") + selectedMenu2Item.offsetHeight + 2;
	            
	            //Calculate menu2 sub elements 
	            //Check not selected sub elements
	            var selectedMenu2SubelementsList = getElementsByClass('menu3td', g("divMenu2Text"), null);
	            if(selectedMenu2SubelementsList.length > 0)
	                selectedElementOffset = selectedMenu2SubelementsList[selectedMenu2SubelementsList.length - 1].offsetTop + selectedMenu2SubelementsList[selectedMenu2SubelementsList.length - 1].offsetHeight + 1;
	            
	            //Check selected sub elements
	            selectedMenu2SubelementsList = getElementsByClass('menu3seltd', g("divMenu2Text"), null);
	            if(selectedMenu2SubelementsList.length > 0)
	            {
	                if(selectedElementOffset < selectedMenu2SubelementsList[selectedMenu2SubelementsList.length - 1].offsetTop + selectedMenu2SubelementsList[selectedMenu2SubelementsList.length - 1].offsetHeight + 1)
	                    selectedElementOffset = selectedMenu2SubelementsList[selectedMenu2SubelementsList.length - 1].offsetTop + selectedMenu2SubelementsList[selectedMenu2SubelementsList.length - 1].offsetHeight + 1;
	            }//if
	            
	            if(selectedElementOffset > g("divMenu2Container").offsetHeight)
	                g("divMenu2Text").style.top = g("divMenu2Container").offsetHeight - selectedElementOffset + "px";
	        }//if
	    }//
	}//if
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)');
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function setupContents()
{
    /* TODO...*/
    switch(pageType)
    {
        case 0:
            /*Frontpage*/
            g('imgFullSizeImage').style.left = 0 + "px";
            g('imgFullSizeImage').style.top = 0 + "px";
            
            var arrowsOffset = 5;
            g('imgFullSizeImageLeftArrow').style.left = crf * arrowsOffset + "px";
            g('imgFullSizeImageLeftArrow').style.top = g('imgFullSizeImage').offsetHeight/2 - g('imgFullSizeImageLeftArrow').offsetHeight/2 + "px";
            
            g('imgFullSizeImageRightArrow').style.left = g('imgFullSizeImage').offsetWidth - g('imgFullSizeImageRightArrow').offsetWidth - (crf * arrowsOffset) + "px";
            g('imgFullSizeImageRightArrow').style.top = g('imgFullSizeImage').offsetHeight/2 - g('imgFullSizeImageRightArrow').offsetHeight/2 + "px";
            
            g('imgBookingLink').style.top = crf * 550 + "px";
            g('imgBookingLink').style.left = crf * 650 + "px";
            
            g('imgFrontPageImageOverlay').style.top = crf * 40 + "px";
            g('imgFrontPageImageOverlay').style.left = crf * 820 + "px";
            
            g('divSignOverlayText').style.top = crf * 75 + "px";
            g('divSignOverlayText').style.left = crf * 845 + "px";
        break;
        case 1:
            /*Article*/
            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = crf * 58 + "px";
            
            g('imgArticleImage').style.left = crf * 658 + "px";
            g('imgArticleImage').style.top = crf * 58 + "px";
            
            var leftBasePoint = crf * 658 + g('imgArticleImage').offsetWidth/2;
            g('imgArticleImageLeftArrow').style.left = leftBasePoint - g('imgArticleImageLeftArrow').offsetWidth - crf * 5 + "px";
            g('imgArticleImageLeftArrow').style.top = crf * 58 + g('imgArticleImage').offsetHeight + crf * 5 + "px";
            
            g('imgArticleImageRightArrow').style.left = leftBasePoint + g('imgArticleImageLeftArrow').offsetWidth + crf * 5 + "px";
            g('imgArticleImageRightArrow').style.top = crf * 58 + g('imgArticleImage').offsetHeight + crf * 5 + "px";
            
            //Setup textfield scrollbars
            setupScrollbars()
        break;
        case 2:
            /* Imageseries*/
            g('imgFullSizeImage').style.left = 0 + "px";
            g('imgFullSizeImage').style.top = 0 + "px";
            
            var arrowsOffset = 5;
            g('imgFullSizeImageLeftArrow').style.left = crf * arrowsOffset + "px";
            g('imgFullSizeImageLeftArrow').style.top = g('imgFullSizeImage').offsetHeight/2 - g('imgFullSizeImageLeftArrow').offsetHeight/2 + "px";
            
            g('imgFullSizeImageRightArrow').style.left = g('imgFullSizeImage').offsetWidth - g('imgFullSizeImageRightArrow').offsetWidth - (crf * arrowsOffset) + "px";
            g('imgFullSizeImageRightArrow').style.top = g('imgFullSizeImage').offsetHeight/2 - g('imgFullSizeImageRightArrow').offsetHeight/2 + "px";
            
			g("photoinfoOpen").style.display = "block";
			g('photoinfoOpen').style.left = rxpos('imgFullSizeImage') + g("imgFullSizeImage").offsetWidth - g("photoinfoOpen").offsetWidth - crf*0 + "px";
			g('photoinfoOpen').style.top = rypos('imgFullSizeImage') + g("imgFullSizeImage").offsetHeight - g("photoinfoOpen").offsetHeight + crf*0 + "px";
			
			showHideImageInfo();
			resizeTextDiv();
			
			if (blnFirstRun){
				g("photoinfoClose").style.display = "none";
				g("Imgtxt").style.display = "none";
			}
			
			applyOpacity("Imgtxt");
			applyOpacity("photoinfoClose");
			applyOpacity("photoinfoOpen");
        break;
        case 3:
            /*Image series with text and sub imagemenu2*/
            var offsetLeft = 0;
            var offsetTop = 65;
            g('divTextFieldBackground').style.left = crf * 58 + crf * offsetLeft + "px";
            g('divTextFieldBackground').style.top = crf * 18 + crf * offsetTop + "px";
            g('divTextFieldBackground').style.width = crf * 475 + "px";
            g('divTextFieldBackground').style.height = (crf * 416) - (offsetTop * crf) + (crf * 30) + "px";
            g('divTextFieldBackground').style.width =  (crf * 500) - (offsetLeft * crf) - (25 * crf) + "px";

            g('divTextField').style.width = g('divTextFieldBackground').style.width;

            g('divImageBackgroundField').style.left = crf * 582 + "px";
            g('divImageBackgroundField').style.top = crf * 18 + "px";
            
            g('divImageLeftBorder').style.left = crf * 582 + crf * 30 - 1 + "px";
            g('divImageLeftBorder').style.top = (crf * 18) + 1 + "px";
            g('divImageLeftBorder').style.height = g('divImageBackgroundField').style.height;
            
            g('divImageRightBorder').style.left = crf * 582 + g('divImageBackgroundField').offsetWidth - crf * 30 - 1 + "px";
            g('divImageRightBorder').style.top = (crf * 18) + 1 + "px";
            g('divImageRightBorder').style.height = g('divImageBackgroundField').style.height;
                     
            g('imgLeftArrow').style.left = crf * 582 + crf * 30 - crf * 5 - g('imgLeftArrow').offsetWidth + "px";
            g('imgLeftArrow').style.top = crf * 18 + g('divImageBackgroundField').offsetHeight/2 - g('imgLeftArrow').offsetHeight/2 + "px";
            
            g('imgRightArrow').style.left = crf * 582 + g('divImageBackgroundField').offsetWidth - crf * 30 + crf * 5 + "px";
            g('imgRightArrow').style.top = crf * 18 + g('divImageBackgroundField').offsetHeight/2 - g('imgRightArrow').offsetHeight/2 + "px";
            
            g('imgActiveImagelistImage').style.left = crf * 582 + crf * 30 + "px";
            g('imgActiveImagelistImage').style.top = (crf * 18) + 1 + "px";
            
            g('divImageMenu2Background').style.left = crf * 58 + "px";
            g('divImageMenu2Background').style.top = (crf * 486) + "px";
            
            g('imgImageMenu2LeftArrow').style.left = crf * 58 + (crf * 30) - (crf * 5) - g('imgImageMenu2LeftArrow').offsetWidth + "px";
            g('imgImageMenu2LeftArrow').style.top = (crf * 486) + (crf * 158)/2 - g('imgImageMenu2LeftArrow').offsetHeight/2 + "px";
            
            g('divImageMenu2Container').style.left =(crf * 30) + "px";
            g('divImageMenu2Container').style.top = 0 + "px";
            
            g('imgImageMenu2RightArrow').style.left = crf * 58 + (crf * 30) + (crf * 1190) + (crf * 5) + "px";
            g('imgImageMenu2RightArrow').style.top = (crf * 486) + (crf * 158)/2 - g('imgImageMenu2RightArrow').offsetHeight/2 + "px";          
            
            g('divImageMenuLeftBorder').style.left = crf * 58 + (crf * 30) + "px";
            g('divImageMenuLeftBorder').style.top = (crf * 486) + 1 + "px";
            g('divImageMenuLeftBorder').style.height = g('divImageMenu2Container').style.height;
            
            g('divImageMenuRightBorder').style.left = crf * 58 + (crf * 30) + (crf * 1190) + "px";
            g('divImageMenuRightBorder').style.top = (crf * 486) + 1 + "px";
            g('divImageMenuRightBorder').style.height = g('divImageMenu2Container').style.height;
                
            if(g("imgClubLaSantaImgLink"))
            {
            	g('imgClubLaSantaImgLink').style.left = rxpos("divContents") + crf * 430 + "px";
            	g('imgClubLaSantaImgLink').style.top = rypos("divContents") + crf * 35 + "px";
            }    
                
            //Setup textfield scrollbars
            setupScrollbars()
            
            
            // Reposition image series
            repositionImageSeries(pageId);

            //Load menupage if needed
            //LoadImageMenuPage(); //NOT USED...
        break;
        case 4:
            /* Contact*/
            g('divTextFieldBackground').style.height = g('divContents').offsetHeight - crf * 58 + "px";
            g('divTextFieldBackground').style.width = g('divContents').offsetWidth - crf * 58 - crf * 50 +  "px";
            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = crf * 58 + "px";
            
            g('divTextField').style.width = g('divTextFieldBackground').style.width;
            
            //Setup textfield scrollbars
            setupScrollbars()
        break;
        case 5:
            /* Imageshow*/
            //g('imgFullSizeImage').style.left = 0  + "px";
            //g('imgFullSizeImage').style.top = 0  + "px";

            //startImageShow('imgFullSizeImage');
            
            g('divFlash').style.left = 0 + "px";
            g('divFlash').style.top = 0 + "px";
        break;
        case 6:
            /*Employee*/
            g('divTextFieldBackground').style.height = g('divContents').offsetHeight - crf * 58 + "px";
            g('divTextFieldBackground').style.width = g('divContents').offsetWidth - crf * 58 - crf * 50 +  "px";
            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = crf * 58 + "px";
            
            g('divTextField').style.width = g('divTextFieldBackground').style.width;
            
            //Setup textfield scrollbars
            setupScrollbars();
        break;
        case 7:
        		g('divFlash').style.left = 0 + "px";
            g('divFlash').style.top = 0 + "px";
            
            g('divNewsTeaser').style.left = crf * 943 + "px";
            g('divNewsTeaser').style.top = crf * 20 + "px";
        break;
        case 8:
            /*HTML*/
        break;
        case 9:
            /*Article*/
            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            g('divTextFieldBackground').style.width = crf * 400 + "px";
            g('divTextFieldBackground').style.height = crf * 510 + "px";
            g('divTextField').style.width = crf * 400 + "px";
            
            g('divLargeArticleImage').style.left = g("divContents").offsetWidth - g("divLargeArticleImage").offsetWidth + "px"; //crf * 658 + "px";
            g('divLargeArticleImage').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            
            g('divArticleTitle').style.left = crf * 58 + "px";
            g('divArticleTitle').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight - g('divArticleTitle').offsetHeight - crf * 10 + "px";
            
            g('imgBookingLink').style.top = crf * 10 + "px";
            g('imgBookingLink').style.left = crf * 1050 + "px";
                  
			var noteRightOffset = g('divNextPrevArrows').offsetWidth;
			if(imageSrcArray.length < 2)
				noteRightOffset = 0;
		
            g('divImageNote').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g("divImageNote").offsetWidth - noteRightOffset  + "px";
            g('divImageNote').style.top  = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            g('divNextPrevArrows').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g('divNextPrevArrows').offsetWidth + "px";
            g('divNextPrevArrows').style.top = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            intDivImageNoteTopHidden = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27;
            intDivImageNoteTopShown = intDivImageNoteTopHidden - g('divImageNoteText').offsetHeight;
            
            resizeTextDiv();
            
            showHideNextPrevImageArrows();
            showHideImageInfo();
            
            //Setup textfield scrollbars
            setupScrollbars();
        break;
        case 10:
            g('divArticleTitle').style.left = crf * 65 + "px";
            g('divArticleTitle').style.top = crf * 70 + "px";
         
        	g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = 117 * crf + "px";
            g('divTextFieldBackground').style.width =  crf * (610 + 30) + "px";
            g('divTextFieldBackground').style.height = crf * 490 + "px";
            
            g('divTextField').style.width = crf * (610) + "px";
            
            g('divLargeArticleImage').style.width = crf * 502 + "px";
            g('divLargeArticleImage').style.height = crf * 538 + "px";
            g('divLargeArticleImage').style.left = g("divContents").offsetWidth - g("divLargeArticleImage").offsetWidth + "px"; //crf * 658 + "px";
            g('divLargeArticleImage').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            
            //g('divImageNote').style.left = g("divContents").offsetWidth - g("divLargeArticleImage").offsetWidth + "px"; //crf * 658 + "px";
            //g('divImageNote').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            g('divImageNote').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g("divImageNote").offsetWidth - g('divNextPrevArrows').offsetWidth + "px";
            g('divImageNote').style.top  = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            g('divNextPrevArrows').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g('divNextPrevArrows').offsetWidth + "px";
            g('divNextPrevArrows').style.top = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            intDivImageNoteTopHidden = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27;
            intDivImageNoteTopShown = intDivImageNoteTopHidden - g('divImageNoteText').offsetHeight;
            
            resizeTextDiv();
            
            showHideNextPrevImageArrows();
            showHideImageInfo();
            
             //Setup textfield scrollbars
            setupScrollbars();
        break;        
        case 11:
            /* Booking*/
            /*g('divTextFieldBackground').style.height = g('divContents').offsetHeight - crf * 58 + "px";
            g('divTextFieldBackground').style.width = g('divContents').offsetWidth - crf * 58 - crf * 50 +  "px";
            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = crf * 58 + "px";
            
            g('divTextField').style.width = g('divTextFieldBackground').style.width;
            */
            g('imgBackToLastPage').style.top = rypos("divSite") + crf * 200 + "px";
            g('imgBackToLastPage').style.left = rxpos("divSite") + crf * 150 + "px";
            
            //Setup textfield scrollbars
            //setupScrollbars();
        break;
        case 12:
            /*Article*/
            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            g('divTextFieldBackground').style.width = crf * 400 + "px";
            g('divTextFieldBackground').style.height = crf * 510 + "px";
            g('divTextField').style.width = crf * 400 + "px";
            
            g('divLargeArticleImage').style.left = g("divContents").offsetWidth - g("divLargeArticleImage").offsetWidth + "px"; //crf * 658 + "px";
            g('divLargeArticleImage').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            
            g('divArticleTitle').style.left = crf * 58 + "px";
            g('divArticleTitle').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight - g('divArticleTitle').offsetHeight - crf * 10 + "px";
            
            g('divImageNote').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g("divImageNote").offsetWidth - g('divNextPrevArrows').offsetWidth + "px";
            g('divImageNote').style.top  = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            g('divNextPrevArrows').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g('divNextPrevArrows').offsetWidth + "px";
            g('divNextPrevArrows').style.top = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            intDivImageNoteTopHidden = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27;
            intDivImageNoteTopShown = intDivImageNoteTopHidden - g('divImageNoteText').offsetHeight;
            
            resizeTextDiv();
            
            showHideNextPrevImageArrows();
            showHideImageInfo();
            
            //Setup textfield scrollbars
            setupScrollbars();
        break;
        case 13:
            /*Frontpage with links*/
            g("divContents").style.width = crf * 1560 + "px";
            g("divContents").style.backgroundImage = "url('standardImg/Frontpage_background_" + jsres + ".jpg')";
        break;
        case 14:
            /*Article_Flash*/

            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = g("divContents").offsetHeight - g("divFlash").offsetHeight + "px";//crf * 58 + "px";
            g('divTextFieldBackground').style.width = crf * 400 + "px";
            g('divTextFieldBackground').style.height = crf * 510 + "px";
            g('divTextField').style.width = crf * 400 + "px";
            
            g('divFlash').style.left = g("divContents").offsetWidth - g("divFlash").offsetWidth + "px"; //crf * 658 + "px";
            g('divFlash').style.top = g("divContents").offsetHeight - g("divFlash").offsetHeight + "px";//crf * 58 + "px";
            
            g('imgBookingLink').style.top = crf * 10 + "px";
            g('imgBookingLink').style.left = crf * 1050 + "px";
            
            g('divArticleTitle').style.left = crf * 58 + "px";
            g('divArticleTitle').style.top = g("divContents").offsetHeight - g("divFlash").offsetHeight - g('divArticleTitle').offsetHeight - crf * 10 + "px";
            
            resizeTextDiv();

            //Setup textfield scrollbars
            setupScrollbars();
        break;
        case 15:
            /*Nyhedsbrev*/
            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            g('divTextFieldBackground').style.width = crf * 400 + "px";
            g('divTextFieldBackground').style.height = crf * 510 + "px";
            g('divTextField').style.width = crf * 400 + "px";
            
            g('divLargeArticleImage').style.left = g("divContents").offsetWidth - g("divLargeArticleImage").offsetWidth + "px"; //crf * 658 + "px";
            g('divLargeArticleImage').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            
            g('divArticleTitle').style.left = crf * 58 + "px";
            g('divArticleTitle').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight - g('divArticleTitle').offsetHeight - crf * 10 + "px";
            
			var noteRightOffset = g('divNextPrevArrows').offsetWidth;
			if(imageSrcArray.length < 2)
				noteRightOffset = 0;
		
            g('divImageNote').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g("divImageNote").offsetWidth - noteRightOffset  + "px";
            g('divImageNote').style.top  = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            g('divNextPrevArrows').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g('divNextPrevArrows').offsetWidth + "px";
            g('divNextPrevArrows').style.top = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            intDivImageNoteTopHidden = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27;
            intDivImageNoteTopShown = intDivImageNoteTopHidden - g('divImageNoteText').offsetHeight;
            
            resizeTextDiv();
            
            showHideNextPrevImageArrows();
            showHideImageInfo();
            
            //Setup textfield scrollbars
            setupScrollbars();
        break; 
        case 16:
            /* Sitemap*/
            g('divTextFieldBackground').style.height = g('divContents').offsetHeight - crf * 58 + "px";
            g('divTextFieldBackground').style.width = g('divContents').offsetWidth - crf * 58 - crf * 50 +  "px";
            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = crf * 58 + "px";
            
            g('divTextField').style.width = g('divTextFieldBackground').style.width;
            
            //Setup textfield scrollbars
            setupScrollbars();
        break;
        case 17:
            /*Article*/
            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            g('divTextFieldBackground').style.width = crf * 400 + "px";
            g('divTextFieldBackground').style.height = crf * 510 + "px";
            g('divTextField').style.width = crf * 400 + "px";
            
            g('divLargeArticleImage').style.left = g("divContents").offsetWidth - g("divLargeArticleImage").offsetWidth + "px"; //crf * 658 + "px";
            g('divLargeArticleImage').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            
            g('divArticleTitle').style.left = crf * 58 + "px";
            g('divArticleTitle').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight - g('divArticleTitle').offsetHeight - crf * 10 + "px";
            
	    			var noteRightOffset = g('divNextPrevArrows').offsetWidth;
	    			if(imageSrcArray.length < 2)
						noteRightOffset = 0;
		
            g('divImageNote').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g("divImageNote").offsetWidth - noteRightOffset  + "px";
            g('divImageNote').style.top  = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            g('divNextPrevArrows').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g('divNextPrevArrows').offsetWidth + "px";
            g('divNextPrevArrows').style.top = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            intDivImageNoteTopHidden = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27;
            intDivImageNoteTopShown = intDivImageNoteTopHidden - g('divImageNoteText').offsetHeight;
            
            resizeTextDiv();
            
            showHideNextPrevImageArrows();
            showHideImageInfo();
            
            //Setup textfield scrollbars
            setupScrollbars();
        break;
        case 18:
            /*Image series with text and sub imagemenu2*/
            var offsetLeft = 0;
            var offsetTop = 3;
            g('divTextFieldBackground').style.left = crf * 58 + crf * offsetLeft + "px";
            g('divTextFieldBackground').style.top = crf * 18 + crf * offsetTop + "px";
            g('divTextFieldBackground').style.width = crf * 475 + "px";
            g('divTextFieldBackground').style.height = (crf * 416) - (offsetTop * crf) + (crf * 30) + "px";
            g('divTextFieldBackground').style.width =  (crf * 500) - (offsetLeft * crf) - (25 * crf) + "px";

            g('divTextField').style.width = g('divTextFieldBackground').style.width;

            g('divImageBackgroundField').style.left = crf * 582 + "px";
            g('divImageBackgroundField').style.top = crf * 18 + "px";
            
            g('divImageLeftBorder').style.left = crf * 582 + crf * 30 - 1 + "px";
            g('divImageLeftBorder').style.top = (crf * 18) + 1 + "px";
            g('divImageLeftBorder').style.height = g('divImageBackgroundField').style.height;
            
            g('divImageRightBorder').style.left = crf * 582 + g('divImageBackgroundField').offsetWidth - crf * 30 - 1 + "px";
            g('divImageRightBorder').style.top = (crf * 18) + 1 + "px";
            g('divImageRightBorder').style.height = g('divImageBackgroundField').style.height;
                     
            g('imgLeftArrow').style.left = crf * 582 + crf * 30 - crf * 5 - g('imgLeftArrow').offsetWidth + "px";
            g('imgLeftArrow').style.top = crf * 18 + g('divImageBackgroundField').offsetHeight/2 - g('imgLeftArrow').offsetHeight/2 + "px";
            
            g('imgRightArrow').style.left = crf * 582 + g('divImageBackgroundField').offsetWidth - crf * 30 + crf * 5 + "px";
            g('imgRightArrow').style.top = crf * 18 + g('divImageBackgroundField').offsetHeight/2 - g('imgRightArrow').offsetHeight/2 + "px";
            
            g('imgActiveImagelistImage').style.left = crf * 582 + crf * 30 + "px";
            g('imgActiveImagelistImage').style.top = (crf * 18) + 1 + "px";
            
            g('divImageMenu2Background').style.left = crf * 58 + "px";
            g('divImageMenu2Background').style.top = (crf * 486) + "px";
            
            g('imgImageMenu2LeftArrow').style.left = crf * 58 + (crf * 30) - (crf * 5) - g('imgImageMenu2LeftArrow').offsetWidth + "px";
            g('imgImageMenu2LeftArrow').style.top = (crf * 486) + (crf * 158)/2 - g('imgImageMenu2LeftArrow').offsetHeight/2 + "px";
            
            g('divImageMenu2Container').style.left =(crf * 30) + "px";
            g('divImageMenu2Container').style.top = 0 + "px";
            
            g('imgImageMenu2RightArrow').style.left = crf * 58 + (crf * 30) + (crf * 1190) + (crf * 5) + "px";
            g('imgImageMenu2RightArrow').style.top = (crf * 486) + (crf * 158)/2 - g('imgImageMenu2RightArrow').offsetHeight/2 + "px";          
            
            g('divImageMenuLeftBorder').style.left = crf * 58 + (crf * 30) + "px";
            g('divImageMenuLeftBorder').style.top = (crf * 486) + 1 + "px";
            g('divImageMenuLeftBorder').style.height = g('divImageMenu2Container').style.height;
            
            g('divImageMenuRightBorder').style.left = crf * 58 + (crf * 30) + (crf * 1190) + "px";
            g('divImageMenuRightBorder').style.top = (crf * 486) + 1 + "px";
            g('divImageMenuRightBorder').style.height = g('divImageMenu2Container').style.height;
                
            //Setup textfield scrollbars
            setupScrollbars();
            
            // Reposition image series
            //repositionImageSeries(pageId);
        break;
        case 19:
             /*Article*/
            g('divTextFieldBackground').style.left = crf * 58 + "px";
            g('divTextFieldBackground').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            g('divTextFieldBackground').style.width = crf * 400 + "px";
            g('divTextFieldBackground').style.height = crf * 510 + "px";
            g('divTextField').style.width = crf * 400 + "px";
            
            g('divLargeArticleImage').style.left = g("divContents").offsetWidth - g("divLargeArticleImage").offsetWidth + "px"; //crf * 658 + "px";
            g('divLargeArticleImage').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight + "px";//crf * 58 + "px";
            
            g('divArticleTitle').style.left = crf * 58 + "px";
            g('divArticleTitle').style.top = g("divContents").offsetHeight - g("divLargeArticleImage").offsetHeight - g('divArticleTitle').offsetHeight - crf * 10 + "px";
            
	    			var noteRightOffset = g('divNextPrevArrows').offsetWidth;
	    			if(imageSrcArray.length < 2)
						noteRightOffset = 0;
		
            g('divImageNote').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g("divImageNote").offsetWidth - noteRightOffset  + "px";
            g('divImageNote').style.top  = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            g('divNextPrevArrows').style.left = -rxpos("divSite") + (rxpos("divSite") - rxpos("divContents")) + rxpos("divLargeArticleImage") + g("divLargeArticleImage").offsetWidth - g('divNextPrevArrows').offsetWidth + "px";
            g('divNextPrevArrows').style.top = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27 + "px";
            
            intDivImageNoteTopHidden = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27;
            intDivImageNoteTopShown = intDivImageNoteTopHidden - g('divImageNoteText').offsetHeight;
            
            resizeTextDiv();
            
            showHideNextPrevImageArrows();
            showHideImageInfo();
            
            //Setup textfield scrollbars
            setupScrollbars();
        break;
        case 20:
            /*Image series with text and sub imagemenu2*/
            var offsetLeft = 0;
            var offsetTop = 3;
            g('divTextFieldBackground').style.left = crf * 58 + crf * offsetLeft + "px";
            g('divTextFieldBackground').style.top = crf * 18 + crf * offsetTop + "px";
            g('divTextFieldBackground').style.width = crf * 475 + "px";
            g('divTextFieldBackground').style.height = (crf * 416) - (offsetTop * crf) + (crf * 30) + "px";
            g('divTextFieldBackground').style.width =  (crf * 500) - (offsetLeft * crf) - (25 * crf) + "px";

            g('divTextField').style.width = g('divTextFieldBackground').style.width;

            g('divImageBackgroundField').style.left = crf * 582 + "px";
            g('divImageBackgroundField').style.top = crf * 18 + "px";
            
            g('divImageLeftBorder').style.left = crf * 582 + crf * 30 - 1 + "px";
            g('divImageLeftBorder').style.top = (crf * 18) + 1 + "px";
            g('divImageLeftBorder').style.height = g('divImageBackgroundField').style.height;
            
            g('divImageRightBorder').style.left = crf * 582 + g('divImageBackgroundField').offsetWidth - crf * 30 - 1 + "px";
            g('divImageRightBorder').style.top = (crf * 18) + 1 + "px";
            g('divImageRightBorder').style.height = g('divImageBackgroundField').style.height;
                     
            g('imgLeftArrow').style.left = crf * 582 + crf * 30 - crf * 5 - g('imgLeftArrow').offsetWidth + "px";
            g('imgLeftArrow').style.top = crf * 18 + g('divImageBackgroundField').offsetHeight/2 - g('imgLeftArrow').offsetHeight/2 + "px";
            
            g('imgRightArrow').style.left = crf * 582 + g('divImageBackgroundField').offsetWidth - crf * 30 + crf * 5 + "px";
            g('imgRightArrow').style.top = crf * 18 + g('divImageBackgroundField').offsetHeight/2 - g('imgRightArrow').offsetHeight/2 + "px";
            
            g('imgActiveImagelistImage').style.left = crf * 582 + crf * 30 + "px";
            g('imgActiveImagelistImage').style.top = (crf * 18) + 1 + "px";
            
            g('divImageMenu2Background').style.left = crf * 58 + "px";
            g('divImageMenu2Background').style.top = (crf * 486) + "px";
            
            g('imgImageMenu2LeftArrow').style.left = crf * 58 + (crf * 30) - (crf * 5) - g('imgImageMenu2LeftArrow').offsetWidth + "px";
            g('imgImageMenu2LeftArrow').style.top = (crf * 486) + (crf * 158)/2 - g('imgImageMenu2LeftArrow').offsetHeight/2 + "px";
            
            g('divImageMenu2Container').style.left =(crf * 30) + "px";
            g('divImageMenu2Container').style.top = 0 + "px";
            
            g('imgImageMenu2RightArrow').style.left = crf * 58 + (crf * 30) + (crf * 1190) + (crf * 5) + "px";
            g('imgImageMenu2RightArrow').style.top = (crf * 486) + (crf * 158)/2 - g('imgImageMenu2RightArrow').offsetHeight/2 + "px";          
            
            g('divImageMenuLeftBorder').style.left = crf * 58 + (crf * 30) + "px";
            g('divImageMenuLeftBorder').style.top = (crf * 486) + 1 + "px";
            g('divImageMenuLeftBorder').style.height = g('divImageMenu2Container').style.height;
            
            g('divImageMenuRightBorder').style.left = crf * 58 + (crf * 30) + (crf * 1190) + "px";
            g('divImageMenuRightBorder').style.top = (crf * 486) + 1 + "px";
            g('divImageMenuRightBorder').style.height = g('divImageMenu2Container').style.height;
                
            //Setup textfield scrollbars
            setupScrollbars();
            
            // Reposition image series
            //repositionImageSeries(pageId);
            break;
        case 21:
    		g('divFlash').style.left = 0 + "px";
            g('divFlash').style.top = 0 + "px";
            
            if(g('divSemiTransparentField')){
                g('divSemiTransparentField').style.left = 0 + "px";
                g('divSemiTransparentField').style.top = 0 + "px";
            }
            if(g('divShowHideSemiTransparentField')){
                g('divShowHideSemiTransparentField').style.left = g('divSemiTransparentField').offsetWidth - g('divShowHideSemiTransparentField').offsetWidth + "px";
                g('divShowHideSemiTransparentField').style.top = -1 + "px";
            }
            
            g('divTextFieldBackground').style.left = crf * 50 + "px";
            g('divTextFieldBackground').style.top = crf * 50 + "px";
            g('divTextFieldBackground').style.width = crf * 400 + "px";
            g('divTextFieldBackground').style.height = crf * 550 + "px";
            g('divTextFieldBackground').style.zIndex = 1002;
            g('divTextField').style.width = crf * 400 + "px";
            
            //Setup textfield scrollbars
            setupScrollbars();
        break;
        case 22:
        	if(g("divTextFieldBackground"))
        	{
        		g('divTextFieldBackground').style.left = crf * 50 + "px";
            g('divTextFieldBackground').style.top = crf * 50 + "px";
            g('divTextFieldBackground').style.width = g("divContents").offsetWidth - crf * 100 + "px";
            g('divTextFieldBackground').style.height = g("divContents").offsetHeight- crf * 100 + "px";
            //g('divTextFieldBackground').style.backgroundColor = "red";
            
            g("divTextField").style.width = g("divContents").offsetWidth - crf * 100 + "px";
        	}
        	//Setup textfield scrollbars
          setupScrollbars();
        break;
        case 23:
        
        	if(g("divTopText"))
        	{
        		g('divTopText').style.left = crf * 90 + "px";
                g('divTopText').style.top = crf * 80 + "px";
        	}//if
        	
        	if(g("divProductTableTile"))
        	{
        		g('divProductTableTile').style.left = crf * 90 + "px";
            g('divProductTableTile').style.top = crf * 150 + "px";
        	}//if
        	
        	if(g("imgProductRightTop"))
        	{
        		g('imgProductRightTop').style.left = crf * 980 + "px";
            g('imgProductRightTop').style.top = crf * 175 + "px";
        	}//if
        	
        	if(g("imgProductRightBottom"))
        	{
        		g('imgProductRightBottom').style.left = crf * 850 + "px";
            g('imgProductRightBottom').style.top = crf * 345 + "px";
        	}//if
        
        	if(g("divTextFieldBackground"))
        	{
        		g('divTextFieldBackground').style.left = crf * 90 + "px";
            g('divTextFieldBackground').style.top = crf * 178 + "px";
            g('divTextFieldBackground').style.width = crf * 650 + "px";
            g('divTextFieldBackground').style.height = crf * 440 + "px";
            
            g("divTextField").style.width = g("divTextFieldBackground").offsetWidth - crf * 50 + "px";
        	}
        	//Setup textfield scrollbars
          setupScrollbars();
        break; 
                           
    }//switch
}


/* Functions for rolling */
function rollLeft(containerId, scrollerId) {
    imgrow = document.getElementById(scrollerId);
    scrollframe = document.getElementById(containerId);
    scroll(1);
}
function rollRight(containerId, scrollerId) {
    imgrow = document.getElementById(scrollerId);
    scrollframe = document.getElementById(containerId);
    scroll(-1);
}
function stopRoll() {
    speed(1);
    clearInterval(timer);	
}

var timer;
var retning;
var speedy=1;
var imgrow;
var scrollframe;
function scroll(ret) {
		retning=parseInt(ret);
		//status=retning;
		timer=setInterval('Doooscroll()',10);	
	}
function Doooscroll() {	
	inW=parseInt(imgrow.offsetWidth);
	outW=parseInt(scrollframe.offsetWidth);
	
	//alert(imgrow.offsetHeight);
	
	diff=inW-outW;
	//status=diff;
	if((retning >0) && (parseInt(imgrow.style.left)>=1-speedy)){		
	    stopRoll();
	    status = "diff=" + diff;
	}else if((retning <0) && (parseInt(imgrow.style.left)<=-diff+speedy)){
	    stopRoll();	
	    status = "diff=" + diff;
    }else{
	    imgrow.style.left=parseInt(imgrow.style.left)+(speedy*1*retning)+'px';	
	    status = "diff=" + diff;
	}	
}	
function speed(tempo) {
	speedy=tempo;
	status = speedy;	
	}


/* Function for image change on mouse over*/
function changeImage(elementId, newImageScr){
    document.getElementById(elementId).src = newImageScr;
}

function nextImageListImage(elementId){
    //Check image source array
    if(imageListIndex < imageSrcArray.length - 1)
    {
    	  //Update current image index
        imageListIndex = imageListIndex + 1;
        
        //Set image source
        document.getElementById(elementId).src = imageSrcArray[imageListIndex];
        
        //check text array index
        if(imageTextsArray.length > imageListIndex)
        {
        	  //Set image text
           if(g('Imgtxt'))
                g("Imgtxt").innerHTML = imageTextsArray[imageListIndex];
            
            if(g('divImageNoteText'))
                g("divImageNoteText").innerHTML = imageTextsArray[imageListIndex];
	    }//if
	    
	    //
	    showHideImageInfo();
	    resizeTextDiv();
    }//if
}//nextImageListImage

function previousImageListImage(elementId){
    //Check image source array
    if(imageListIndex > 0)
    {
    	  //Update current image index
        imageListIndex = imageListIndex - 1;
        
        //Set image source
        document.getElementById(elementId).src = imageSrcArray[imageListIndex];
        
        //check text array index
        if(imageTextsArray.length > imageListIndex)
        {
        	   //Set image text
            if(g('Imgtxt'))
                g("Imgtxt").innerHTML = imageTextsArray[imageListIndex];
            
            if(g('divImageNoteText'))
                g("divImageNoteText").innerHTML = imageTextsArray[imageListIndex];
	    }//if
	    
	    //
	    showHideImageInfo();
	    resizeTextDiv();
    }//if
}

function link(path){
window.location = path;
}

function fakePostBack(url, callerId){

    if (document.getElementById("ifrm") != null) {
        document.getElementById("ifrm").setAttribute("src", "nopostback_handler.asp?" + url + "&res=" + jsres);
    }
    
    //Update selected image
    var childNodeArray = document.getElementById('divImageMenu2Scroller').childNodes;
    for(var i = 0; i < childNodeArray.length; i++)
    {
        if(childNodeArray[i].id == callerId)
            childNodeArray[i].className = "aSelectedImageLink";
        else
        {
            childNodeArray[i].className = "aImageLink";
            if(childNodeArray[i].childNodes[0])
                childNodeArray[i].childNodes[0].style.borderColor = "#000000";
        }//else
    }
    return false;
}

function RebuildImageArray()
{
    //Setup image texts and sources
	imageTextsArray = imageListTexts.substring(1,imageListTexts.length-2).split("','");
	imageSrcArray = imageListImages.substring(0, imageListImages.length -1).split(',');
}//RebuildImageArray

String.prototype.endsWith = function(str)
{
    return (this.match(str+"$")==str)
}

function LoadImageMenuPage(){
    //Check hash
    if(window.location.hash.replace("#", "").length > 0){
        var pageId = window.location.hash.replace("#", "");
        var childNodeArray = document.getElementById('divImageMenu2Scroller').childNodes;
        for(var i = 0; i < childNodeArray.length; i++)
        {
            if(childNodeArray[i].id.endsWith("_" + pageId))
            {
                childNodeArray[i].className = "aSelectedImageLink";
                var linkPath = childNodeArray[i].href;
                var params = linkPath.substring(linkPath.indexOf("?") +1);
                if (document.getElementById("ifrm") != null)
                    document.getElementById("ifrm").setAttribute("src", "nopostback_handler.asp?" + params + "&res=" + jsres +""+ window.location.hash);
                    
               //Srcoll imagemenu
               if( rxpos(childNodeArray[i].id) > g('divImageMenu2Container').offsetWidth)
               {
                    g('divImageMenu2Scroller').style.left = 0 - (rxpos(childNodeArray[i].id) - g('divImageMenu2Container').offsetWidth - rxpos('divImageMenu2Container') + g(childNodeArray[i].id).offsetWidth ) + "px";
               }
            }//if
            else
            {
                childNodeArray[i].className = "aImageLink";
            }//else
        }//for
    }//if
}//LoadImageMenuPage

function showHideImageScrollArrows(){
    var localImageSrcList = imageListImages.substring(0, imageListImages.length -1);
    var imageSrcArray = new Array();
    imageSrcArray = localImageSrcList.split(',');
    if(imageListImages.length > 0)
    {
        if(g('imgArticleImage'))
            g('imgArticleImage').style.visibility='visible';
            
        if(g('imgFullSizeImage'))
            g('imgFullSizeImage').style.visibility='visible';
    }//if
    else
    {
        if(g('imgArticleImage'))
            g('imgArticleImage').style.visibility='hidden';
            
        if(g('imgFullSizeImage'))
            g('imgFullSizeImage').style.visibility='hidden';
    }//else    
        
    if(imageSrcArray.length > 1)
    {
        //Show next/previous arrow
        if(g('imgArticleImageLeftArrow'))
            g('imgArticleImageLeftArrow').style.visibility='visible';
           
        if(g('imgArticleImageRightArrow')) 
            g('imgArticleImageRightArrow').style.visibility='visible';
        
        if(g('imgFullSizeImageLeftArrow'))
            g('imgFullSizeImageLeftArrow').style.visibility='visible';
        
        if(g('imgFullSizeImageRightArrow'))
            g('imgFullSizeImageRightArrow').style.visibility='visible';
        
        if(g('imgLeftArrow'))
            g('imgLeftArrow').style.visibility='visible';
        
        if(g('imgRightArrow'))
            g('imgRightArrow').style.visibility='visible';
    }//if
    else
    {
        //Hide next/previous arrow
        if(g('imgArticleImageLeftArrow'))
            g('imgArticleImageLeftArrow').style.visibility='hidden';
        
        if(g('imgArticleImageRightArrow'))
            g('imgArticleImageRightArrow').style.visibility='hidden';
        
        if(g('imgFullSizeImageLeftArrow'))
            g('imgFullSizeImageLeftArrow').style.visibility='hidden';
        
        if(g('imgFullSizeImageRightArrow'))
            g('imgFullSizeImageRightArrow').style.visibility='hidden';
        
        if(g('imgLeftArrow'))
            g('imgLeftArrow').style.visibility='hidden';
        
        if(g('imgRightArrow'))
            g('imgRightArrow').style.visibility='hidden';
    }//else
}

function showHideTextScrollArrows(containerId, scrollerId, arrowContainerId){
    if (document.getElementById(containerId) != null && document.getElementById(scrollerId) != null && document.getElementById(arrowContainerId) != null)
    {
        if(document.getElementById(containerId).offsetHeight < document.getElementById(scrollerId).offsetHeight)
        {
            showdiv(arrowContainerId);
        }//if
        else
        {
            hidediv(arrowContainerId);
        }//else
    }//if
}//

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

var imageShowPointer = 0;
var imageShowMaxCount = 0;
function startImageShow(imageElement){
    //init
    imageShowPointer = 0;
    imageShowMaxCount = imageListImages.substring(0, imageListImages.length -1).split(',').length;
    
    setInterval('imageshowNextImage('+imageElement +')',4000);
}

function imageshowNextImage(imageElement){
    if(imageShowPointer < imageShowMaxCount - 1)
        imageShowPointer++;
    else
        imageShowPointer = 0;
        
    var nextImage = imageListImages.substring(0, imageListImages.length -1).split(',')[imageShowPointer];
    
    imageElement.src = nextImage;
}

function SetupImageMenuScroll()
{
    var id = 'ImageMenuScroller';
    //Call create scrollbar 2 times....
    createScrollbar(id, 'divTextFieldBackground', 'divTextField', g("divTextFieldBackground").offsetWidth+rxpos("divTextFieldBackground") + crf*10, 0, 1000);
    createScrollbar(id, 'divTextFieldBackground', 'divTextField', g("divTextFieldBackground").offsetWidth+rxpos("divTextFieldBackground") + crf*10, 0, 1000);
}//SetupImageMenuScroll

function setupScrollbars()
{
	createScrollbar('1', 'divTextFieldBackground', 'divTextField', g("divTextFieldBackground").offsetWidth+rxpos("divTextFieldBackground") + crf*10, 0, 1000);
	
	/*
	if (blnHideScrollbars != 0) return;
	
	intSpace = -1;
	if (is_ie) intSpace = 0;

	if (
	
			   g("divTextFieldBackground")
			&& g("divTextField")
			&& g("divScrollbarMainText")
			&& g("divScrollSliderMainText")
			&& g("imgArrowScrolbarMainTextUp")
			&& g("imgArrowScrolbarMainTextDown")
		)
	{
	    //Update slider
	    g("divScrollSliderMainText").style.width = resValue(3,5,7) + "px";
	
		if (g("divTextFieldBackground").offsetHeight >= g("divTextField").offsetHeight)
		{
			// hide scrollbar
			g("divScrollbarMainText").style.display         = "none";
			g("divScrollSliderMainText").style.display      = "none";
			g("imgArrowScrolbarMainTextUp").style.display   = "none";
			g("imgArrowScrolbarMainTextDown").style.display = "none";
		} else {
		
			// setup scrollbar
			g("divScrollbarMainText").style.display         = "block";
			g("divScrollSliderMainText").style.display      = "block";
			g("imgArrowScrolbarMainTextUp").style.display   = "block";
			g("imgArrowScrolbarMainTextDown").style.display = "block";

			g("imgArrowScrolbarMainTextUp").style.left = right("divTextFieldBackground") + crf*15 + "px";
			g("imgArrowScrolbarMainTextUp").style.top  = top("divTextFieldBackground") + "px";

			g("imgArrowScrolbarMainTextDown").style.left = left("imgArrowScrolbarMainTextUp") + "px";
			g("imgArrowScrolbarMainTextDown").style.top  = bottom("divTextFieldBackground") - g("imgArrowScrolbarMainTextDown").offsetHeight + "px";


			g("divScrollbarMainText").style.left   = rxpos("imgArrowScrolbarMainTextUp") + g("imgArrowScrolbarMainTextUp").offsetWidth/2 + intSpace + "px";
			g("divScrollbarMainText").style.top    = bottom("imgArrowScrolbarMainTextUp") + crf*10 + "px";
			g("divScrollbarMainText").style.height = top("imgArrowScrolbarMainTextDown") - bottom("imgArrowScrolbarMainTextUp") - crf*10*2 + "px";

            
    
			if (blnHideScrollbars == 0)
			{
			    if (scrollerMainText == null)
			    {
				    scrollerMainText = new textScroller(scrollerCount++);
			    }
			    scrollerMainText = new textScroller(scrollerCount++);
			    scrollerMainText.masterobj = 'divTextFieldBackground';
			    scrollerMainText.scrollerobj = 'divTextField';
			    scrollerMainText.scrollbar = 'divScrollbarMainText';
			    scrollerMainText.arrowobj = 'divScrollSliderMainText'; //fake shit
			    scrollerMainText.scrollslider = 'divScrollSliderMainText';
			    scrollerMainText.prepare();
			}
		}
	}
	*/
}



//********** show/hide imagetext
var lukstateimg=2;
function toggleImgTxt() {	
	if (lukstateimg == 1) {
		lukstateimg=2;	
		g("Imgtxt").style.display = "none";
		g("photoinfoClose").style.display = "none";
		g("photoinfoOpen").style.display = "block";
	}else{		
		lukstateimg=1;		
		g("Imgtxt").style.display = "block";
		g("photoinfoClose").style.display = "block";
		g("photoinfoOpen").style.display = "none";		
		//g('Imgtxt').style.top = rypos('photoinfo') - g("Imgtxt").offsetHeight + g("photoinfo").offsetHeight - p(jsRF * 1) + "px";
	}
	
	showHideImageInfo();
	resizeTextDiv();
}

function resizeTextDiv(){
    if(g("Imgtxt"))
    {
        if (g("Imgtxt").style.display != "none")
        {        
            g('Imgtxt').style.left = rxpos('imgFullSizeImage') + g("imgFullSizeImage").offsetWidth - g("Imgtxt").offsetWidth +"px";//- crf*0 + "px";
            g('Imgtxt').style.top = rypos('imgFullSizeImage') + g("imgFullSizeImage").offsetHeight - g("Imgtxt").offsetHeight + crf*0 + "px";
        }
    }

    if(g("photoinfoClose"))
    {
        if (g("photoinfoClose").style.display != "none")
        {		
            g('photoinfoClose').style.left = rxpos('imgFullSizeImage') + g("imgFullSizeImage").offsetWidth - g("photoinfoClose").offsetWidth - crf*0 + "px";
            g('photoinfoClose').style.top = rypos('Imgtxt') - g("photoinfoClose").offsetHeight + 1 + "px";
        }
    }
    
    if(g('divImageNote'))
    {    
        intDivImageNoteTopHidden = -rypos("divSite") + (rypos("divSite") - rypos("divContents")) + rypos("divLargeArticleImage") + g("divLargeArticleImage").offsetHeight - crf * 27;
        intDivImageNoteTopShown = intDivImageNoteTopHidden - g('divImageNoteText').offsetHeight;
                
		//divImageNoteContainer.style.height = crf*29 + "px";

        if( divImageNoteHidden )
            g('divImageNote').style.top = intDivImageNoteTopHidden + "px";
        else
            g('divImageNote').style.top = intDivImageNoteTopShown + "px";
    }//if
}

function applyOpacity(elementId){
    g(elementId).style.MozOpacity  = 0.7;
    g(elementId).style.filter = "alpha(opacity=70);";
}

function showHideImageInfo(){

    var textArray = imageListTexts.split("',");
    var text = textArray[imageListIndex].substring(1, textArray[imageListIndex].length);
    
    //Remove line break
    while(text.indexOf("<br>") > -1 || text.indexOf("<br>") > -1 || text.indexOf("<br/>") > -1 || text.indexOf("<br />") > -1 || text.indexOf("<br  />") > -1 || text.indexOf("&nbsp;") > -1)
    {
        text = text.replace("<br>","");
        text = text.replace("<br >","");
        text = text.replace("<br/>","");
        text = text.replace("<br />","");
        text = text.replace("<br  />","");
        text = text.replace("&nbsp;","");
    }//while
    
    if(text.length == 1 && text.indexOf("'") > -1)
        text = "";
    
    if(text.length > 0)
    {
        if(g('divImageNote'))
            g('divImageNote').style.visibility = "visible";
    }//if
    else
    {   
        if(g('divImageNote'))
            g('divImageNote').style.visibility = "hidden";
    }//else
}//showHideImageInfo

function setBackgroundImage(obj,img, color)
{
    if (typeof(obj) == "string") obj = g(obj);
    if (obj)
    {
        if (color.substring(0,1) != "#") color = "#" + color;
        obj.style.backgroundImage = "url('" + img + "')";
        obj.firstChild.style.color = color;
    }
}

/* moussa, tblImageNote */
var divImageNoteHidden = true;
function showhideImageNote()
{
    if ( g("tblImageNote") )
    {
        if( divImageNoteHidden )
        {
            g('divImageNote').style.top = intDivImageNoteTopShown + "px";
            g('divImageNoteTextCaption').innerHTML = hideImageText;
            divImageNoteHidden = false;
        }
        else
        {
            g('divImageNote').style.top = intDivImageNoteTopHidden + "px";
            g('divImageNoteTextCaption').innerHTML = showImageText;
            divImageNoteHidden = true;
        }//else
    }//if
}//showhideImageNote

function showHideNextPrevImageArrows()
{
    if(imageListImages.substring(0, imageListImages.length -1).split(',').length > 1)
    {
        if('divNextPrevArrows')
            g('divNextPrevArrows').style.visibility = "visible";
    }//if
    else
    {
        if('divNextPrevArrows')
            g('divNextPrevArrows').style.visibility = "hidden";
    }//else
}//showHideNextPrevImageArrows

function setImgBorder(element, on, id, isFirst)
{
	colorOn  = "#335a77"; 
	colorOff = "#000000";

	if(isFirst == 1)
	{
		classOn  = "menu2seltdFirst";
		classOff = "menu2tdFirst";
	}
	else
	{
		classOn  = "menu2seltd";
		classOff = "menu2td";
	}
	
	objTd = g("tdMenu2Item" + id);
	objImg = g("alink_page_" + id);

	if(on == 1)
	{
		if (objImg) 
		    objImg.childNodes[0].style.borderColor = colorOn;
		
		if (objTd) 
		    objTd.className = classOn;
	} 
	else 
	{
		if (objImg) 
		    objImg.childNodes[0].style.borderColor = colorOff;
		if (objTd) 
		    objTd.className = classOff;
	}//else
}//setImgBorder

function repositionImageSeries(hash)
{
      if (hash == "") return;

      for(i = 0, len = arrImageSeriesIds.length; i < len; i++)
      {
        if ("" + arrImageSeriesIds[i] == "" + hash)
        {
             hash = i;
             break;
        }
      }
        
      hash = parseInt(hash);
      children = g("divImageMenu2Scroller").childNodes;
      
      if (children.length - hash < 4)
      {
        hash = children.length - 5;
      } 
      else 
      {
        if (hash > 2)
        {
            hash = hash - 2;
        } 
        else 
        {
            hash = 0;
        }
      }
      g("divImageMenu2Scroller").style.left = 0-(hash * (crf*233) + hash*5) + "px";
}

function setArticleImage(newSource, hash)
{
    g("imgActiveImagelistImage").src = newSource;
    imageListIndex = hash;
    /*
    hash = parseInt(hash);
    children = g("divImageMenu2Scroller").childNodes;
  
    if (children.length - hash < 4)
    {
        hash = children.length - 5;
    } 
    else 
    {
        if (hash > 2)
        {
            hash = hash - 2;
        } 
    else 
    {
        hash = 0;
    }
  }
  g("divImageMenu2Scroller").style.left = 0-(hash * (crf*233) + hash*5) + "px";*/
}

var menu2Direction = 0;
var menu2Speed = 1;
var menu2Timer = 0;

function setMenu2Direction(newDirection)
{
    //Check new direction
    menu2Direction = newDirection;
    
    //Check direction and start timer if needed
    if(menu2Direction != 0)
        menu2Timer = setInterval('moveMenu2()',10);	       
}//setMenu2Direction

function setMenu2Speed(newSpeed)
{
    //Set new speed
    menu2Speed = newSpeed;
}//setMenu2Speed

function moveMenu2()
{
    //Calc new offset
    var offset = g("divMenu2Text").offsetTop + (menu2Direction * menu2Speed);
    //var offset = rxpos("divMenu2Text") + (menu2Direction * menu2Speed);
    
    //Check max offset
    if(menu2Direction == -1 && (offset * menu2Direction) > g("divMenu2Text").offsetHeight - g("divMenu2Container").offsetHeight)
    {
        offset = (g("divMenu2Text").offsetHeight - g("divMenu2Container").offsetHeight) * menu2Direction;
    }
    else if(menu2Direction == 1 && offset > 0)
    {
        offset = 0;
    }//else if
    
    //Move menu2
    g("divMenu2Text").style.top = offset + "px";
    
    //Check direction and clear timer if needed
    if(menu2Direction == 0)
        clearTimeout(menu2Timer);
}//moveMenu2

function toggleField(buttonElement, hideTextId, showTextId, strFieldId)
{
    //Show/Hide field
    if(g(strFieldId).style.display == "block"){
        g(strFieldId).style.display = "none";
        g('divTextFieldBackground').style.display = "none";
        g('divScrollbar1').style.display = "none";
        g('divScrollSlider1').style.display = "none";
        g('imgArrowScrolbar1Up').style.display = "none";
        g('imgArrowScrolbar1Down').style.display = "none";
    }
    else{
        g(strFieldId).style.display = "block";
        g('divTextFieldBackground').style.display = "block";
        g('divScrollbar1').style.display = "block";
        g('divScrollSlider1').style.display = "block";
        g('imgArrowScrolbar1Up').style.display = "block";
        g('imgArrowScrolbar1Down').style.display = "block";
    }
    
    //Toggle text
    if(g(showTextId).style.display == "block")
        g(showTextId).style.display = "none";
    else{
        g(showTextId).style.display = "block";
        g('imgShowTextField').style.display = "block";
    }
        
    if(g(hideTextId).style.display == "block")
        g(hideTextId).style.display = "none";
    else{
        g(hideTextId).style.display = "block";
    }
    
    //Move button
    if(g(strFieldId).style.display == "block"){
        buttonElement.style.left = g(strFieldId).offsetWidth - buttonElement.offsetWidth + "px";
    }
    else{
        buttonElement.style.left = -1 + "px";
    }    
}

function ReInitScrollbars()
{
	setupScrollbars();
	setupScrollbars();
	
	
	if(g("divScrollSlider1").style.display == "none"){
	    g("divTextField").style.top = 0+ "px";
	}//if
}
