﻿if (top != self) top.location.href = window.location.href;

function checkSoeg(s)  {
  if (document.forms[0].sg.value == "søg") {
  	document.forms[0].sg.value = '';     
  }
}

var arrScrollers			= new Array();
var oldMouseUp = null;
document.onmouseup = function()
{
	//document.title = "mouse up";
	//document.title = "";
	for(i = 0, len = arrScrollers.length; i < len; i++)
	{
		obj = arrScrollers[i];
		//alert(obj);
		if (obj != null && typeof(obj) != "undefined")
		{
			//document.title += obj.masterobj + ", ";
			obj.cancelScroll();
			obj.endDrag();
			obj.alterSpeed(0);
			obj.moving = false;
		}
	}
};
/*************************** Vedr. Forside Tekstboks *************************************/

function displayFrontProductTeaser(teaserItem){
	//alert("over");
	$("#divProductTeaser").css( "display", 'block' )
	
	g('divProductTeaser').innerHTML = g(teaserItem).innerHTML;
	
	if(g('divProductTeaser').style.left <= 0){
		if(g('divProductTeaser')){	
		g('divProductTeaser').style.left = rxpos('Site')+ (g('divContentsFlash').offsetWidth/2) - (g('divProductTeaser').offsetWidth/2)+ p(jsRF * 22) + "px";
		g('divProductTeaser').style.top = rypos('Site')+ p(jsRF * (222+50)) + "px";
		}
		
	}	

}



function removeFrontProductTeaser(){
	//alert("out");
	$("#divProductTeaser").css( "display", 'none' )
	}

/*************************** Vedr. Tekstboks *************************************/

//When dom is ready.
$(document).ready(function() {
  
  
	$('#togglephotoImage').click(function() {
	//$('#togglephotoImage').mouseover(function() {	
		//alert("hey");
		//divBoxCenterTextMaster 
		 
		 if($("#divBoxCenterTextMaster").css("display")== 'block'){

		 	$("#ScrollbarContainer").css( "display", 'none' )
		 	
		 	}
		 
    $("#divBoxCenterTextMaster").animate({ 'height': 'toggle' }, 1000, '', function() {
    	//$("#ScrollbarContainer").animate({ 'height': 'toggle' }, 1000, '', function() { });
    	
    	if($("#divBoxCenterTextMaster").css("display")== 'block'){
    		$("#ScrollbarContainer").css( "display", 'block' )
    	}
    	
    });
    
	});

});


/****************************************************************/

//if (strPageType != 12) {

	var intScrollerCounter = 0;
	var scrollerBoxCenter = null;
	var scrollerReference = null;
	var scrollerTeknisk = null;
	var scrollerMiljoe = null;
	var scrollerFordele = null;
	var scrollerVejstrategi = null;
//}


function resValue(r0,r1,r2)
{
	if (jsres == 0)
	{
		return r0;
	} else {
		if (jsres == 1)
		{
			return r1;
		} else {
			return r2;
		}
	}
}
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].className.toLowerCase().indexOf("nopng") == -1 ){
			if (pngimg[i].src.toLowerCase().indexOf(".png") > -1)
			{
				pngimg[i].className += " overlay";
			}
		}
		
	}
}
/*
function addReturnFalseToLinks()
{
lnx = document.links;
for (i=0,len=lnx.lenght;i<len;i++){
	if(lnx[i].href == "#"){
		lnx.onclick= function(){return false;}
		}
	
	}
}
*/

//***************************** slide

var objProductButtons = null;
var objProductButtonsColorOn  = "#50b948";
var objProductButtonsColorOff = ""; // "#959ca1";

if (window.location.search.toString().indexOf("&Prodemp=1") != -1)
{
	objProductButtons = g("divProductButtonsContact");
	objProductButtons.style.backgroundColor = objProductButtonsColorOn;
}


var strBoxActive = "";

function showBox(txtSource, obj, strBoxId)
{

		/********* fjern vejstrategi og vis tekst***********/
		g('imgvejstrategi').style.display = 'none';
		g('divBoxCenterTextMaster').style.display = 'block';
		g('ScrollbarContainer').style.display = 'block';



		/********* Knappens farve ***********/
		if (objProductButtons != null)
		{
			objProductButtons.style.backgroundColor = objProductButtonsColorOff;
		}
		objProductButtons = obj.childNodes[0];
		objProductButtons.style.backgroundColor = objProductButtonsColorOn;

		/********* Indhold skiftes ***********/	
		g("divBoxCenterTextDocument").innerHTML = g("divDocument"+strBoxId).innerHTML;

		/********* scrollbar fjernes evt. ***********/	
			//alert(g("divBoxCenterTextMaster").clientHeight + " / " + g("divBoxCenterTextDocument").clientHeight  + " / " + g("divBoxCenterTextMaster").style.maxHeight);
			//alert($("#divBoxCenterTextMaster").height());
		
		var m = g("divBoxCenterTextMaster").style.maxHeight.split("px");
		mi = parseInt(m[0])
		
		if (g("divBoxCenterTextMaster").clientHeight <= mi) {
			//alert ("skjul scrollbar");
			$("#ScrollbarContainer").css( "display", 'none' )
			}
}

function showBoxOLD(txtSource, obj, strBoxId)
{
		
		
		
		if (objProductButtons != null)
		{
			objProductButtons.style.backgroundColor = objProductButtonsColorOff;
		}

		objProductButtons = obj.childNodes[0];
		objProductButtons.style.backgroundColor = objProductButtonsColorOn;



			g("divBoxCenterTextMaster").style.visibility = "hidden";
			g("imgArrowScrolbarBoxCenterUp").style.visibility = "hidden";
			g("imgArrowScrolbarBoxCenterDown").style.visibility = "hidden";
			g("divScrollbarBoxCenter").style.visibility = "hidden";
			g("divScrollSliderBoxCenter").style.visibility = "hidden";
	
			if (strBoxActive != "")
			{
				g("divMaster" + strBoxActive).style.visibility = "hidden";
				g("divDocument" + strBoxActive).style.visibility = "hidden";
				g("imgArrowScrolbar" + strBoxActive + "Up").style.visibility = "hidden";
				g("imgArrowScrolbar" + strBoxActive + "Down").style.visibility = "hidden";
				g("divScrollbar" + strBoxActive).style.visibility = "hidden";
				g("divScrollSlider" + strBoxActive).style.visibility = "hidden";
			}

			strBoxActive = strBoxId;
			
			
		
			g("divMaster" + strBoxActive).style.visibility = "visible";
			g("divDocument" + strBoxActive).style.visibility = "visible";
			g("imgArrowScrolbar" + strBoxActive + "Up").style.visibility = "visible";
			g("imgArrowScrolbar" + strBoxActive + "Down").style.visibility = "visible";
			g("divScrollbar" + strBoxActive).style.visibility = "visible";
			g("divScrollSlider" + strBoxActive).style.visibility = "visible";
		
			

			
			lukstate=2;

			g("divMaster" + strBoxActive).style.filter = "alpha(opacity=90);";
			g("divMaster" + strBoxActive).style.MozOpacity  = 0.9;	


}


function swapImg(item,thisImage){
	g(item).src = thisImage;
	
	}


function getTxtfieldToContent(txtSource, obj)
{

	// 2009-05-29 12-52, moussa
	// note: no longer in use
	

	if (objProductButtons != null)
	{
		objProductButtons.style.backgroundColor = objProductButtonsColorOff;
	}

	objProductButtons = obj.childNodes[0];
	objProductButtons.style.backgroundColor = objProductButtonsColorOn;

	
	//alert(txtSource);
	g('divBoxCenterTextDocument').innerHTML = g(txtSource).innerHTML;
	g("divBoxCenterTextMaster").style.filter = "alpha(opacity=90);";
	g("divBoxCenterTextMaster").style.MozOpacity  = 0.9;	


		lukstate=2;

		if( g("divBoxCenterTextDocument").offsetHeight < g("divBoxCenterTextMaster").offsetHeight)	{
			g("imgArrowScrolbarBoxCenterUp").style.display = "none";
			g("imgArrowScrolbarBoxCenterDown").style.display = "none";
			g("divScrollbarBoxCenter").style.display = "none";
			g("divScrollSliderBoxCenter").style.display = "none";
		} else {
			g("divBoxCenterTextMaster").style.display = "block";
			g("imgArrowScrolbarBoxCenterUp").style.display = "block";
			g("imgArrowScrolbarBoxCenterDown").style.display = "block";
			g("divScrollbarBoxCenter").style.display = "block";
			g("divScrollSliderBoxCenter").style.display = "block";
			// man kan endnu ikke scrolle
		}

		/*
		if (isM)
		{
			document.title = "";
			//removeScrollbar(arrScrollers, scrollerBoxCenter)

			alert("hide it");

			g("divBoxCenterTextMaster").style.visibility = "hidden";
			g("imgArrowScrolbarBoxCenterUp").style.visibility = "hidden";
			g("imgArrowScrolbarBoxCenterDown").style.visibility = "hidden";
			g("divScrollbarBoxCenter").style.visibility = "hidden";
			g("divScrollSliderBoxCenter").style.visibility = "hidden";
	
			
		}
		*/

	
	return false;
	}

var oldwheelHandler = null;
function removeScrollbar(arr, obj)
{
	blnRemove = false;
	for( var i = 0, len = arr.length; i < len; i++)
	{
		if (arr[i] == obj)
		{
			arr.splice(i,1);
			blnRemove = true;
			//alert("removed");
			document.title += "removed, ";
			break;
		}
	}

	//oldwheelHandler = obj.wheelHandler;
	//alert(oldwheelHandler);
	g("divBoxCenterTextDocument").style.top = 0 + "px";

if( g("divBoxCenterTextDocument").offsetHeight > g("divBoxCenterTextMaster").offsetHeight)
{
	//g("divScrollSliderBoxCenter").style.top = rypos("imgArrowScrolbarBoxCenterUp") + crf*10 + "px";

	document.title += "enable scroll";

	obj = new textScroller(1);
	obj.masterobj = 'divBoxCenterTextMaster';
	obj.scrollerobj = 'divBoxCenterTextDocument';
	obj.scrollbar = 'divScrollbarBoxCenter';
	obj.arrowobj = 'divScrollSliderBoxCenter'; //fake shit
	obj.scrollslider = 'divScrollSliderBoxCenter';
	obj.prepare();
	if(typeof(arrScrollers) == "object") arrScrollers[arrScrollers.length] = scrollerBoxCenter;

	obj.scrollUp();
	obj.scrollDown();
	///obj.cancelScroll();
	obj.endDrag();
	obj.alterSpeed(-1);
	//setTimeout("function() { obj.cancelScroll(); }", 750);

	////g("divBoxCenterTextMaster").style.top = 0 + "px";
	////g("divScrollbarBoxCenter").style.top = 0 + "px";


} else {
	document.title += "DISABLE scroll";
	obj.prepare();
	if  (obj.wheelHandler) obj.wheelHandler = function() { return false; };
}
	
	/*
if( g("divBoxCenterTextDocument").offsetHeight < g("divBoxCenterTextMaster").offsetHeight)
{
	obj.wheelHandler = function() { return false; };
} else {

	obj.prepare();
	if (obj.wheelHandler & "" == "function() { return false; }")
	{
		obj.wheelHandler = oldwheelHandler;
	}
}
	*/
	/*
	obj = new textScroller(1);
	obj.masterobj = 'divBoxCenterTextMaster';
	obj.scrollerobj = 'divBoxCenterTextDocument';
	obj.scrollbar = 'divScrollbarBoxCenter';
	obj.arrowobj = 'divScrollSliderBoxCenter'; //fake shit
	obj.scrollslider = 'divScrollSliderBoxCenter';
	obj.prepare();
	*/

}


function displayContactpersontxt(ContactDiv){
	//alert(ContactDiv);
	
	g('divEmployeeData').innerHTML = g(ContactDiv).innerHTML;
	//g('divEmployeeData').innerHTML = 'fisk';
	//alert(g('divEmployeeData').innerHTML);
	}

function mouseEmployees(n,e) {
	
	if ( n==1){
		//alert(e.childNodes[0].childNodes[0]);
		//alert(e.childNodes[6].id);
	e.style.color = "#54B948";
	e.style.borderBottomColor = "#54B948";
	e.childNodes[0].childNodes[0].style.border = "#54B948 1px solid";
	//e.childNodes[6].style.border = "1px solid #54B948";
	}else{	
	e.style.color = "#99A0A6";
	e.style.borderBottomColor = "#99A0A6";
	e.childNodes[0].childNodes[0].style.border = "#ffffff 1px solid";
	//e.childNodes[6].style.border = "1px solid #99A0A6";
	}
	
	return false;
	}


//***************************** slide

var intCurrImg = 0;

function tjekImagetxt() {
			
		if( arrPageImagestxt[intCurrImg] != "<br><br>" ){
			g('Imgtxt').innerHTML = arrPageImagestxt[intCurrImg];
			//g("photoinfo").style.display = "block";
			//g("photoinfoTab").style.display = "block";
			
			g("photoinfo").style.visibility = "visible";
			g("photoinfoTab").style.visibility = "visible";			
		}else{
			g('Imgtxt').innerHTML = "";
			//g("photoinfo").style.display = "none";
			//g("photoinfoTab").style.display = "none";
			g("photoinfo").style.visibility = "hidden";
			g("photoinfoTab").style.visibility = "hidden";				
		}		
	}



///////////////////////////////////////// vejstrategi 03-07-2009 14:51
function vejstrategiImage() {
	//alert("vejstrategiImage");
	//g('MainImage').style.backgroundImage = "url(\"" + arrPageImages[intCurrImg] + "\")";
	//g('MainImage').style.backgroundImage = "url(\"img_articles/vejstrategi_2.png\")";
	
	//g('MainImage').style.backgroundImage = "url(\"img_articles/vejstrategi_" + jsres + ".png\")";
	g('imgvejstrategi').style.display = 'block';
	
	g('divBoxCenterTextMaster').style.display = 'none';
	g('ScrollbarContainer').style.display = 'none';
	
//	togglePhoto();
	
}

function currentImage() {
	if(typeof(arrPageImages)!="undefined") {
		//intCurrImg += 1;
		//if(intCurrImg>=arrPageImages.length) {
		//	intCurrImg = 0;
		//}
		g('MainImage').style.backgroundImage = "url(\"" + arrPageImages[intCurrImg] + "\")";
		tjekImagetxt();
	}	
}

///////////////////////////////////////// END vejstrategi

function nextImage() {
	if(typeof(arrPageImages)!="undefined") {
		intCurrImg += 1;
		if(intCurrImg>=arrPageImages.length) {
			intCurrImg = 0;
		}
		
		g('MainImage').style.backgroundImage = "url(\"" + arrPageImages[intCurrImg] + "\")";
		
		
		
		tjekImagetxt();
	}	
}

function prevImage() {
	if(typeof(arrPageImages)!="undefined") {
		intCurrImg -= 1;
		if(intCurrImg<0) {
			intCurrImg = arrPageImages.length - 1;
		}
		g('MainImage').style.backgroundImage = "url(\"" + arrPageImages[intCurrImg] + "\")";
		tjekImagetxt();	
	}
}
function thisImage() {
		intCurrImg = intCurrImgThumb;
		g('MainImage').style.backgroundImage = "url(\"" + arrPageImages[intCurrImg] + "\")";
		g('Imgtxt').innerHTML = arrPageImagestxt[intCurrImg];	
		/*if (lukstateimg == 1) {
		toggleImgTxt();
		}	*/
		//g('Imgtxt').style.top = rypos('photoinfo') - g("Imgtxt").offsetHeight + g("photoinfo").offsetHeight - p(jsRF * 1) + "px";
		
		if( arrPageImagestxt[intCurrImg] != "<br><br>" ){
			g("photoinfo").style.display = "block";
		}else{
			g("photoinfo").style.display = "none";
		}	
		
		
		
}
//***************************** Thumbslide
var intCurrImgThumb = 0;
function nextImageThumb() {
	if(typeof(arrPageImagesThumb)!="undefined") {
		intCurrImgThumb += 1;
		if(intCurrImgThumb>=arrPageImagesThumb.length) {
			intCurrImgThumb = 0;
		}
		g('thumb').src = arrPageImagesThumb[intCurrImgThumb];
		g('currthumb').innerHTML = intCurrImgThumb + 1;
	}
}
function prevImageThumb() {
	if(typeof(arrPageImagesThumb)!="undefined") {
		intCurrImgThumb -= 1;
		if(intCurrImgThumb<0) {
			intCurrImgThumb = arrPageImagesThumb.length - 1;
		}
		g('thumb').src = arrPageImagesThumb[intCurrImgThumb];
		g('currthumb').innerHTML = intCurrImgThumb + 1;
	}
}
//***************************** show/hide text
var lukstate=2;
function togglePhoto() {
	
	
	//alert(strBoxActive);
	//document.title = lukstate;
	if (lukstate == 1) {
		lukstate=2;	
	
		g("divBoxCenterTextMaster").style.display = "block";
		g("imgArrowScrolbarBoxCenterUp").style.display = "block";
		g("imgArrowScrolbarBoxCenterDown").style.display = "block";
		g("divScrollbarBoxCenter").style.display = "block";
		g("divScrollSliderBoxCenter").style.display = "block";
		
		show_hideBox(strBoxActive, "visible");
		
		//g("imgArrowLeft").style.display = "none";	
		//g("imgArrowRight").style.display = "none";
				
	}else{		
		lukstate=1;		
	
		g("divBoxCenterTextMaster").style.display = "none";
		g("imgArrowScrolbarBoxCenterUp").style.display = "none";
		g("imgArrowScrolbarBoxCenterDown").style.display = "none";
		g("divScrollbarBoxCenter").style.display = "none";
		g("divScrollSliderBoxCenter").style.display = "none";
		
		show_hideBox(strBoxActive, "hidden");
		
		if (arrPageImages.length != 0) {
		g("imgArrowLeft").style.display = "block";	
		g("imgArrowRight").style.display = "block";
	}
	}
}

function show_hideBox(boxname, state) {	
		
		g("divMaster" + boxname).style.visibility = state;
		g("divDocument" + boxname).style.visibility = state;
		g("divScrollbar" + boxname).style.visibility = state;
		g("divScrollSlider" + boxname).style.visibility = state;
		g("imgArrowScrolbar"+ boxname+"Up").style.visibility = state;
		g("imgArrowScrolbar"+ boxname+"Down").style.visibility = state;		

	}




//***************************** show/hide imagetext
var lukstateimg=2;
function toggleImgTxt() {	
	if (lukstateimg == 1) {
		lukstateimg=2;	
		g("Imgtxt").style.display = "none";
		g('photoinfo').style.top = rypos('Imgbottomline') - g("photoinfo").offsetHeight  + "px";
		g('photoinfoTab').style.top = rypos('Imgbottomline') - g("photoinfoTab").offsetHeight + 1 + "px";
	}else{		
		lukstateimg=1;		
		g("Imgtxt").style.display = "block";

		g('photoinfo').style.top = rypos('Imgtxt') - g("photoinfo").offsetHeight  + "px";	
		g('photoinfoTab').style.top = rypos('Imgtxt') - g("photoinfoTab").offsetHeight + 1 + "px";
	}
	
}

//***************************** show/hide Front

var lukstatefront=2;
function togglePhotoFront() {	
	if (lukstatefront == 1) {
		lukstatefront=2;	
		g("frontContent").style.display = "block";
		g("frontmap").style.display = "block";
		g("dots_front_right").style.display = "block";
		g("frontNews").style.display = "block";
		g("frontOffer").style.display = "block";		

			
	}else{		
		lukstatefront=1;		
		g("frontContent").style.display = "none";
		g("frontmap").style.display = "none";
		g("dots_front_right").style.display = "none";
		g("frontNews").style.display = "none";
		g("frontOffer").style.display = "none";		
	}
}




//***************************** Stuff
var ie5;
var ns6;
function startup() {
	ie5=document.all&&document.getElementById;
	ns6=document.getElementById&&!document.all;
	ie6=!!( document.all && (/msie 6./i).test(navigator.appVersion) && window.ActiveXObject );
}

function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}


function delayPositionThings() {
		setTimeout("positionThings()", 500);
}

var blnFirstRun = true;

function positionThings() {


	if (blnFirstRun){
		//if (!isM || 2 == 2)
		//{
		if(window.captureEvents)
		{
			window.onmousemove=sourceCheck;
		} else {
			document.onmousemove=sourceCheck;
		}
		
		//}
		addPngFix();
		//addReturnFalseToLinks();
		
	}



	var pageSize = getPageSize();
	//var pageHeight = (ie5 ? pageSize[1] : pageSize[3]);
	var pageWidth = (ie5 ? pageSize[0] : pageSize[2]);


	/*
	g('Site').style.top = p((pageHeight - g('Site').offsetHeight) / 2) + "px";
	if(p(g('Site').style.top) < 0) {
		g('Site').style.top = "0px";
	}
	*/
	if(g('Site')){
	g('Site').style.left = p((pageWidth - g('Site').offsetWidth) / 2) + "px";
	if(p(g('Site').style.left) < 0) {
		g('Site').style.left = "0px";
	}
	}

	var siteleft = rxpos('Site') + g('Site').offsetWidth;


	if(g('divPreloader')){	
		g('divPreloader').style.left = rxpos('Site') + p(jsRF * 400) + "px";
		g('divPreloader').style.top = rypos('Site') + p(jsRF * 300) + "px";
	}
	
	if(g('Logo')){	
		//g('Logo').style.left = rxpos('Site') + p(jsRF * 830) + "px";
		g('Logo').style.left = siteleft - g('Logo').offsetWidth - 1 + "px";
		g('Logo').style.top = rypos('Site') + p(jsRF * 32) + "px";
	}
	
	

		
	if(g('hovedmenu')){	
		g('hovedmenu').style.left = rxpos('Logo') - g('hovedmenu').offsetWidth + p(jsRF * 20) + "px";
		g('hovedmenu').style.top = rypos('Site') + p(jsRF * 32) + "px";
	}




	
	if(g('hovedmenu_line')){	
		g('hovedmenu_line').style.left = rxpos('Site') + 1 + "px";
		//g('hovedmenu_line').style.top = rypos('Site') + p(jsRF * 52) + "px";
		g('hovedmenu_line').style.top = rypos('hovedmenu')+ g('hovedmenu').offsetHeight - g('hovedmenu_line').offsetHeight + p(jsRF * 0) + "px";
	}
	if(g('hovedmenu_gradient')){	
		g('hovedmenu_gradient').style.left = rxpos('Site') + 1 + "px";
		g('hovedmenu_gradient').style.top = rypos('Site') + p(jsRF * 54) + "px";
	}

	if(g('menu2_gradient')){	
		g('menu2_gradient').style.left = rxpos('Site') + 1 + "px";
		g('menu2_gradient').style.top = rypos('Site') + p(jsRF * 93) + "px";
	}


	if(g('LangSelection')){	
		//g('LangSelection').style.left = siteleft - p(jsRF * 33) + "px";
		g('LangSelection').style.left = siteleft - 50 + "px";
		g('LangSelection').style.top =  p(jsRF * 5) + "px";
	}
	
	if(g('home_print_search')){	
		//g('home_print_search').style.left = siteleft - p(jsRF * 57) + "px";
		g('home_print_search').style.left = siteleft - 85 + "px";
		g('home_print_search').style.top =  p(jsRF * 5) + "px";
	}
	
	
	if(g('divAddThis')){	
		//g('divAddThis').style.left = siteleft - p(jsRF * 57) + "px";
		g('divAddThis').style.left = siteleft - 220 + "px";
		g('divAddThis').style.top =  p(jsRF * 5) + "px";
	}	
	

	if(g('divSearch')){	
		g('divSearch').style.left = siteleft - g('divSearch').offsetWidth - p(jsRF * 174) + "px";
		g('divSearch').style.top =  resValue(116,144,179)- g('divSearch').offsetHeight + "px";
	}	

	
	if(g('toplinks')){	
		g('toplinks').style.left = rxpos('Site') + p(jsRF * 10) + "px";
		g('toplinks').style.top = rypos('Site') + p(jsRF * 5) + "px";
	}
	
	
	if(g('adresse')){	
		g('adresse').style.left = rxpos('Site') + p(jsRF * 0) + "px";
		g('adresse').style.top = rypos('Site') + p(jsRF * (575-15)) + "px";
	}

	if(g('divContactsImage')){	
		g('divContactsImage').style.left = rxpos('Site') + p(jsRF * (280-9)) + "px";
		g('divContactsImage').style.top = rypos('Site') + p(jsRF * 221) + "px";
	}


	
	/*
	if(g('contact')){	
		g('contact').style.left = rxpos('Site')+ p(jsRF * 12) + "px";
		g('contact').style.top = rypos('Site')+ p(jsRF * 552) + "px";
	}
	*/
	




switch (strPageType)

{
	case 1: //Artikel (Tekst og billedserie)
		setTopImage();
		setMainImage();
		setPhotoinfo();
		setArticleMenu2();
		setArticleMenu3();
		setContent();
	break;
	case 2: //Artikel (Tekst i fuld bredde)
		setTopImage();
		setArticleMenu2();
		setArticleMenu3();
			
	break;
	case 9: //Produktartikel (Tekst og billedserie)")
		setProductMenu2();
		setProductMenu3();
		setMainImage();
		setPhotoinfo();
		setContentProduct();
		setReferences();
		setReferenceHeadline();
	break;	
	case 3: //Produkt
		setProductMenu2();
		setProductMenu3();
		setMainImage();
		setPhotoinfo();	
		setContentProduct();
		setReferences();
		setReferenceHeadline();
		setProductButtons();
	break;
	case 4: //Opgave
		setProductMenu2();
		setProductMenu3();
		setMainImage();
		setPhotoinfo();
		setContentProduct();
		setReferences();
		setReferenceHeadline();	
	break;
	case 5: //Nyhed
		setTopImage();
		setReferences();
		//setContentNews();
		
		setMainImage();
		setPhotoinfo();
		setContentProduct();		
		
	break;
	case 13: //Job
		setTopImage();
		setReferences();
		setContentNews();
	break;	
	
	case 6: //Kontaktformular
		setTopImage();
		setArticleMenu2();
		setContentNews();	
	break;
	case 7: //Kontaktpersoner
		setTopImage();
		setArticleMenu2();
		setReferences();
		setReferenceHeadline();
		setEmployee();	
	break;
	case 8: //Forside
		setTopImage();
		
		
		if(g('divContentsFlash')){	
		g('divContentsFlash').style.left = rxpos('Site')+ p(jsRF * 22) + "px";
		g('divContentsFlash').style.top = rypos('Site')+ p(jsRF * 222) + "px";
		}	


//		if(g('divProductTeaser')){	
//		g('divProductTeaser').style.left = rxpos('Site')+ (g('divContentsFlash').offsetWidth/2) - (g('divProductTeaser').offsetWidth/2)+ p(jsRF * 22) + "px";
//		g('divProductTeaser').style.top = rypos('Site')+ p(jsRF * 222) + "px";
//		}	
		
		if(g('frontContent')){	
		g('frontContent').style.left = rxpos('divContentsFlash')+ g('divContentsFlash').offsetWidth + p(jsRF * 27) + "px";
		g('frontContent').style.top = rypos('Site')+ p(jsRF * 222) + "px";
		}
					
		if(g('frontNews')){	
		g('frontNews').style.left = rxpos('frontContent') + "px";
		//g('frontNews').style.top = rypos('Site')+ p(jsRF * 455) + "px";
		
		g('frontNews').style.top = rypos('divContentsFlash') + g('divContentsFlash').offsetHeight - g('frontNews').offsetHeight - p(jsRF * 72) + "px";
		
		if (ie6){
			//alert("ie6");
			
			g('frontNews').style.top = rypos('divContentsFlash') + g('divContentsFlash').offsetHeight - g('frontNews').offsetHeight  + "px";
			}
		
		}			
		
		setMenu2ProductsFront();
		
	break;	
	case 10: //Kontaktpersoner
		setTopImage();
		setArticleMenu2();
		setReferences();
		setReferenceHeadline();
		setEmployee();	
	break;
	case 11: //Artikel (Tekst i fuld bredde)
		setTopImage();
		setArticleMenu2();
		//setArticleMenu3();
		setIframe();
		case 14: // Iframe x 2
		setTopImage();
		setArticleMenu2();
		//setArticleMenu3();
		setIframe2();
	case 12: //medarbejdere (Tekst i fuld bredde)
		setTopImage();
		//setArticleMenu2();
		//setArticleMenu3();
		
		setIframe();		
	case 500: //søgeresultat
		setTopImage();
		setArticleMenu2();
		//setContentNews();
		setContentsearchresult();
	
			
	break;	
	}
if(blnFirstRun){
tjekImagetxt();
}
//alert(strPageType);



blnFirstRun = false;
	
}

function setMainImage_new() {

		
		if(g('slideshow')){
		g('slideshow').style.left = rxpos('Site')+ p(jsRF * 60) + "px";
		g('slideshow').style.top = rypos('Site')+ p(jsRF * 170) + "px";	
		}		
		
				
		g('imgArrowLeft').style.left = rxpos('slideshow') - p(jsRF * 18) + "px";
		g('imgArrowLeft').style.top = rypos('slideshow')+ g("slideshow").offsetHeight/2 - p(jsRF * 8) + "px";
		g("imgArrowLeft").style.display = "none";			

		g('imgArrowRight').style.left = rxpos('slideshow') + g("slideshow").offsetWidth + p(jsRF * 2) + "px";
		g('imgArrowRight').style.top = rypos('slideshow')+ g("slideshow").offsetHeight/2 - p(jsRF * 8) + "px";
		g("imgArrowRight").style.display = "none";	
		
		//if (arrPageImages.length != 0) {
		if (arrPageImages.length >= 2) {
			g("imgArrowLeft").style.display = "block";	
			g("imgArrowRight").style.display = "block";
		}
			
	}
	
function setMainImage() {
		if(g('MainImage')){
		g('MainImage').style.left = rxpos('Site')+ p(jsRF * 60) + "px";
		g('MainImage').style.top = rypos('Site')+ p(jsRF * 170) + "px";	
		}
	
		g('imgArrowLeft').style.left = rxpos('MainImage') - p(jsRF * 18) + "px";
		g('imgArrowLeft').style.top = rypos('MainImage')+ g("MainImage").offsetHeight/2 - p(jsRF * 8) + "px";
		g("imgArrowLeft").style.display = "none";			

		g('imgArrowRight').style.left = rxpos('MainImage') + g("MainImage").offsetWidth + p(jsRF * 2) + "px";
		g('imgArrowRight').style.top = rypos('MainImage')+ g("MainImage").offsetHeight/2 - p(jsRF * 8) + "px";
		g("imgArrowRight").style.display = "none";	
		
		//if (arrPageImages.length != 0) {
		if (arrPageImages.length >= 2) {
			g("imgArrowLeft").style.display = "block";	
			g("imgArrowRight").style.display = "block";
		}
			
	}	
	
	
function setEmployee() {
		if(g('DivEmployee')){
		g('DivEmployee').style.left = rxpos('Site')+ p(jsRF * 60) + "px";
		g('DivEmployee').style.top = rypos('Site')+ p(jsRF * 170) + "px";	
		}		

			
	}	


function setIframe() {
		if(g('divIframe')){
		g('divIframe').style.left = rxpos('Site')+ p(jsRF * 60) + "px";
		g('divIframe').style.top = rypos('Site')+ p(jsRF * 170) + "px";	
		
		if(g('divBoxCenterTextMaster')){
			g("divBoxCenterTextMaster").style.display = "none";

			g("imgArrowScrolbarBoxCenterUp").style.display = "none";
			g("imgArrowScrolbarBoxCenterDown").style.display = "none";
			g("divScrollbarBoxCenter").style.display = "none";
			g("divScrollSliderBoxCenter").style.display = "none";
		}
		
		}		

			
	}
	
function setIframe2() {
		if(g('divIframe')){
		g('divIframe').style.width = p(jsRF * 430) + "px";
		g('divIframe').style.left = rxpos('Site')+ p(jsRF * 60) + "px";

		
		
		g('divIframe').style.top = rypos('Site')+ p(jsRF * 170) + "px";	
		
		
		g("divBoxCenterTextMaster").style.display = "none";
		g("imgArrowScrolbarBoxCenterUp").style.display = "none";
		g("imgArrowScrolbarBoxCenterDown").style.display = "none";
		g("divScrollbarBoxCenter").style.display = "none";
		g("divScrollSliderBoxCenter").style.display = "none";
		
		}		
		if(g('divIframe2')){
		g('divIframe2').style.width = p(jsRF * 430) + "px";
		g('divIframe2').style.left = rxpos('Site')+ p(jsRF * 60)+ p(jsRF * 450) + "px";
		g('divIframe2').style.top = rypos('Site')+ p(jsRF * 170) + "px";	
		}
		

	}	
	
function setTopImage() {
		if(g('top_image')){	
		g('top_image').style.left = rxpos('Site') + 1 + "px";
		g('top_image').style.top = rypos('Site') + p(jsRF * 54) + "px";
		}	
	}
function setProductMenu2() {
	if(g('menu2Products')){	
		g('menu2Products').style.left = rxpos('Site') + 1 + "px";
		//g('menu2Products').style.top = rypos('Site') + resValue(74,93,116) + "px";
		g('menu2Products').style.top = rypos('Site') + resValue(76,93,116) + "px";
	}
}

function setMenu2ProductsFront() {
	if(g('menu2ProductsFront')){	
		g('menu2ProductsFront').style.left = rxpos('divContentsFlash') + 0 + "px";
		g('menu2ProductsFront').style.top = rypos('Site') + resValue(138,172,216) + "px";
	}
}
function setProductMenu3() {
	if(g('menu3Products')){	
		
		g('menu3Products').style.width = p(jsRF * 659) + "px";
		g('menu3Products').style.left = rxpos('Site')+ p(jsRF * 60) + "px";
		//g('menu3Products').style.top = rypos('Site') + resValue(129,164,205) + "px";
		//g('menu3Products').style.top = rypos('Site') + resValue(129,164,205)- g("menu3Products").offsetHeight + "px";
		g('menu3Products').style.top = rypos('Site')+ p(jsRF * 170) - g("menu3Products").offsetHeight - p(jsRF * 5) + "px";
		//alert(g("menu3Products").offsetHeight);
	}
}	
function setArticleMenu2() {
	if(g('menu2Articles')){	
		g('menu2Articles').style.left = rxpos('Site')+ p(jsRF * 60) + "px";
		g('menu2Articles').style.top = rypos('Site') + resValue(147,184,230) + "px";
	}
}
function setArticleMenu3() {
	if(g('menu3Articles')){
		g('menu3Articles').style.width = resValue(660,824,1030) + "px";	
		g('menu3Articles').style.left = rxpos('Site')+ p(jsRF * 60) + 0 + "px";
		g('menu3Articles').style.top = rypos('MainImage')+ g("MainImage").offsetHeight + resValue(0,0,0)+ "px";
	}
}

function setProductButtons() {
	if(g('ProductButtons')){
		g('ProductButtons').style.width = resValue(660,824,1030) + "px";	
		g('ProductButtons').style.left = rxpos('Site')+ p(jsRF * 60) + 0 + "px";
		g('ProductButtons').style.top = rypos('MainImage')+ g("MainImage").offsetHeight + resValue(0,0,0)+ "px";
	}
}

function setPhotoinfo() {

	if(g('Imgtxt')){	
		g('Imgtxt').style.width = p(jsRF * 200) + "px";
		g('Imgtxt').style.height = p(jsRF * 40) + "px";
		g('Imgtxt').style.left = rxpos('MainImage') + g("MainImage").offsetWidth - (g("Imgtxt").offsetWidth) + "px";
		g('Imgtxt').style.top = rypos('MainImage')+ g("MainImage").offsetHeight - (g("Imgtxt").offsetHeight) + "px";

		g("Imgtxt").style.display = "none";			
	}
	
	
	if(g('Imgbottomline')){	
		g('Imgbottomline').style.width = g("MainImage").offsetWidth - 2 + "px";
		

		g('Imgbottomline').style.height = p(jsRF * 7) + "px";

		
		g('Imgbottomline').style.left = rxpos('MainImage') + 1 + "px";
		
		g('Imgbottomline').style.top = rypos('MainImage')+ g("MainImage").offsetHeight - (g("Imgbottomline").offsetHeight) + "px";

		g("Imgbottomline").style.display = "block";			
	}	

		
	if(g('photoinfo')){
		//g("photoinfo").style.width = p(jsRF * 70) + "px";
		g('photoinfo').style.left = rxpos('MainImage')+ g("MainImage").offsetWidth - (g("photoinfo").offsetWidth) - p(jsRF * 20) + "px";			
		g('photoinfo').style.top = rypos('Imgbottomline') - g("photoinfo").offsetHeight- p(jsRF * 3)  + "px";
	}		
	

	if(g('photoinfoTab')){
		//g("photoinfoTab").style.width = p(jsRF * 70) + "px";
		g('photoinfoTab').style.left = rxpos('MainImage')+ g("MainImage").offsetWidth - (g("photoinfoTab").offsetWidth) - 1 + "px";			
		g('photoinfoTab').style.top = rypos('Imgbottomline') - g("photoinfoTab").offsetHeight + 1 + "px";
	}	
	
}
function setContentProduct() {
	
	if(g('divBoxCenterTextMaster'))
	{	
			g("divBoxCenterTextMaster").style.left = rxpos('Site') + p(jsRF * 286) + "px";
			g("divBoxCenterTextMaster").style.top = rypos('MainImage') + p(jsRF * 0) + "px";
			g("divBoxCenterTextMaster").style.width = p(jsRF * 416) + "px";

			if(g('divMasterTeknisk'))
			{
				g("divMasterTeknisk").style.left = rxpos('divBoxCenterTextMaster') + "px";
				g("divMasterTeknisk").style.top = rypos('divBoxCenterTextMaster') + "px";
				g("divMasterTeknisk").style.width = p(jsRF * 416) + "px";

				g("divMasterMiljoe").style.left = rxpos('divMasterTeknisk') + "px";
				g("divMasterMiljoe").style.top = rypos('divMasterTeknisk') + "px";
				g("divMasterMiljoe").style.width = p(jsRF * 416) + "px";

				g("divMasterFordele").style.left = rxpos('divMasterTeknisk') + "px";
				g("divMasterFordele").style.top = rypos('divMasterTeknisk') + "px";
				g("divMasterFordele").style.width = p(jsRF * 416) + "px";
				
				g("divMasterVejstrategi").style.left = rxpos('divMasterTeknisk') + "px";
				g("divMasterVejstrategi").style.top = rypos('divMasterTeknisk') + "px";
				g("divMasterVejstrategi").style.width = p(jsRF * 416) + "px";				

				/*
				if (isM)
				{
					g('divBoxCenterTextMaster').style.visibility = "hidden";
					g("imgArrowScrolbarBoxCenterUp").style.visibility = "hidden";
					g("imgArrowScrolbarBoxCenterDown").style.visibility = "hidden";

					g('divMasterTeknisk').style.visibility = "visible";
					g('divDocumentTeknisk').style.visibility = "visible";
				}
				*/
			}


			if(intProdemp == 1) {
				g("divBoxCenterTextMaster").style.filter = "alpha(opacity=100);";
				g("divBoxCenterTextMaster").style.MozOpacity  = 1;				
				
			}else{
				g("divBoxCenterTextMaster").style.filter = "alpha(opacity=90);";
				g("divBoxCenterTextMaster").style.MozOpacity  = 0.9;

				if(g('divMasterTeknisk'))
				{
					g('divMasterTeknisk').style.filter = "alpha(opacity=90);";
					g('divMasterTeknisk').style.MozOpacity  = 0.9;
				}

				if(g('divMasterMiljoe'))
				{
					g('divMasterMiljoe').style.filter = "alpha(opacity=90);";
					g('divMasterMiljoe').style.MozOpacity  = 0.9;
				}

				if(g('divMasterFordele'))
				{
					g('divMasterFordele').style.filter = "alpha(opacity=90);";
					g('divMasterFordele').style.MozOpacity  = 0.9;
				}
				

				if(g('divMasterVejstrategi'))
				{
					g('divMasterVejstrategi').style.filter = "alpha(opacity=90);";
					g('divMasterVejstrategi').style.MozOpacity  = 0.9;
				}
			}

			

			if(g('imgArrowScrolbarBoxCenterUp') && g("imgArrowScrolbarBoxCenterDown") ){	
					g("imgArrowScrolbarBoxCenterUp").style.left = rxpos("divBoxCenterTextMaster") + g("divBoxCenterTextMaster").offsetWidth - jsRF*10 - g("imgArrowScrolbarBoxCenterUp").offsetWidth /2 + "px";
					g("imgArrowScrolbarBoxCenterUp").style.top  = rypos("divBoxCenterTextMaster") + p(jsRF * 30) + "px";
			
			
					g("imgArrowScrolbarBoxCenterDown").style.left = rxpos("imgArrowScrolbarBoxCenterUp") + "px";
					g("imgArrowScrolbarBoxCenterDown").style.top  = rypos("divBoxCenterTextMaster") + g("divBoxCenterTextMaster").offsetHeight - g("imgArrowScrolbarBoxCenterDown").offsetHeight - p(jsRF * 10)+ "px";
			}
			
	}

	if(g('divScrollbarBoxCenter')){		
			g("divScrollbarBoxCenter").style.left   = rxpos("imgArrowScrolbarBoxCenterUp") + g("imgArrowScrolbarBoxCenterUp").offsetWidth/2 + "px";
			g("divScrollbarBoxCenter").style.top    = rypos("imgArrowScrolbarBoxCenterUp") + jsRF*10 + "px";
			g("divScrollbarBoxCenter").style.height = rypos("imgArrowScrolbarBoxCenterDown") - g("imgArrowScrolbarBoxCenterDown").offsetHeight + jsRF*2 - rypos("divScrollbarBoxCenter") + "px";
	}

	if(g('divScrollSliderBoxCenter')){	
			g("divScrollSliderBoxCenter").style.top = rypos("divScrollbarBoxCenter")+ "px";
			g("divScrollSliderBoxCenter").style.left = rxpos("divScrollbarBoxCenter") - g("divScrollSliderBoxCenter").offsetWidth/2 + "px";				
	}


	if( g("divBoxCenterTextDocument").offsetHeight > g("divBoxCenterTextMaster").offsetHeight)	{
		
		if (scrollerBoxCenter == null)
		{
			scrollerBoxCenter = new textScroller(intScrollerCounter++);
		}
		scrollerBoxCenter.masterobj = 'divBoxCenterTextMaster';
		scrollerBoxCenter.scrollerobj = 'divBoxCenterTextDocument';
		scrollerBoxCenter.scrollbar = 'divScrollbarBoxCenter';
		scrollerBoxCenter.arrowobj = 'divScrollSliderBoxCenter'; //fake shit
		scrollerBoxCenter.scrollslider = 'divScrollSliderBoxCenter';
		scrollerBoxCenter.prepare();	
		if(typeof(arrScrollers) == "object") arrScrollers[arrScrollers.length] = scrollerBoxCenter;
	}

	if( g("divBoxCenterTextDocument").offsetHeight < g("divBoxCenterTextMaster").offsetHeight)	{
			g("imgArrowScrolbarBoxCenterUp").style.display = "none";
			g("imgArrowScrolbarBoxCenterDown").style.display = "none";
			g("divScrollbarBoxCenter").style.display = "none";
			g("divScrollSliderBoxCenter").style.display = "none";
	}


	//if (isM || 2 == 2)
	//{
		setupScrollbar(scrollerTeknisk, "Teknisk");
		setupScrollbar(scrollerMiljoe, "Miljoe");
		setupScrollbar(scrollerFordele, "Fordele");
		setupScrollbar(scrollerVejstrategi, "Vejstrategi");
	//}
	

	if(g('togglephoto')){
		//g("togglephoto").style.width = p(jsRF * 70) + "px";
		g('togglephoto').style.left = rxpos('divBoxCenterTextMaster') + g("divBoxCenterTextMaster").offsetWidth - p(jsRF * 16) + "px";		
		g('togglephoto').style.top = rypos('MainImage') + p(jsRF * 5) + "px";
	}
	
}	


function setReferences() {
	if(g('divReferenceMaster')){	
		
			//g("divReferenceMaster").style.left = rxpos('MainImage') + g("MainImage").offsetWidth + p(jsRF * 58) + "px";
			//g("divReferenceMaster").style.top = rypos('MainImage') + p(jsRF * 0) + "px";
			
			g("divReferenceMaster").style.left =  rxpos('Site') + p(jsRF * 780) + "px";
			g("divReferenceMaster").style.top =  rypos('Site')+ p(jsRF * 170) + "px";	
			g("divReferenceMaster").style.width = p(jsRF * 172) + "px";
			g("divReferenceMaster").style.filter = "alpha(opacity=90);";
			g("divReferenceMaster").style.MozOpacity  = 0.9;
	
	
					if(g('imgArrowScrolbarReferenceUp') && g("imgArrowScrolbarReferenceDown") ){
							
							g("imgArrowScrolbarReferenceUp").style.left = rxpos("divReferenceMaster") + g("divReferenceMaster").offsetWidth + jsRF*10 - g("imgArrowScrolbarReferenceUp").offsetWidth /2 + "px";
							g("imgArrowScrolbarReferenceUp").style.top  = rypos("divReferenceMaster") + p(jsRF * 0) + "px";
					
					
							g("imgArrowScrolbarReferenceDown").style.left = rxpos("imgArrowScrolbarReferenceUp") + "px";
							g("imgArrowScrolbarReferenceDown").style.top  = rypos("divReferenceMaster") + g("divReferenceMaster").offsetHeight - g("imgArrowScrolbarReferenceDown").offsetHeight - p(jsRF * 0)+ "px";
					}
			
			}
		if(g('divScrollbarReference')){		
				g("divScrollbarReference").style.left   = rxpos("imgArrowScrolbarReferenceUp") + g("imgArrowScrolbarReferenceUp").offsetWidth/2 + "px";
				g("divScrollbarReference").style.top    = rypos("imgArrowScrolbarReferenceUp") + jsRF*10 + "px";
				g("divScrollbarReference").style.height = rypos("imgArrowScrolbarReferenceDown") - g("imgArrowScrolbarReferenceDown").offsetHeight + jsRF*2 - rypos("divScrollbarReference") + "px";
		}
	
		if(g('divScrollSliderReference')){	
				g("divScrollSliderReference").style.top = rypos("divScrollbarReference")+ "px";
				g("divScrollSliderReference").style.left = rxpos("divScrollbarReference") - g("divScrollSliderReference").offsetWidth/2 + "px";				
		}

			if( g("divReferenceDocument").offsetHeight < g("divReferenceMaster").offsetHeight)	{
				g("imgArrowScrolbarReferenceUp").style.display = "none";
				g("imgArrowScrolbarReferenceDown").style.display = "none";
				g("divScrollbarReference").style.display = "none";
				g("divScrollSliderReference").style.display = "none";
			} else {
				if (scrollerReference == null)
				{
					scrollerReference = new textScroller(2);
				}
				scrollerReference.masterobj = 'divReferenceMaster';
				scrollerReference.scrollerobj = 'divReferenceDocument';
				scrollerReference.scrollbar = 'divScrollbarReference';
				scrollerReference.arrowobj = 'divScrollSliderReference'; //fake shit
				scrollerReference.scrollslider = 'divScrollSliderReference';
				scrollerReference.prepare();	
				if(typeof(arrScrollers) == "object") arrScrollers[arrScrollers.length] = scrollerReference;
			}
	
}	

function setReferenceHeadline() {

			g("divReferenceHeadline").style.left = rxpos('divReferenceMaster') + p(jsRF * 0) + "px";
			//g("divReferenceHeadline").style.top = rypos('Site') + p(jsRF * 148) + "px";
			g("divReferenceHeadline").style.top = rypos('Site') + p(jsRF * 148)- resValue(3,0,0) + "px";
			
			g("divReferenceHeadline").style.width = g("divReferenceMaster").offsetWidth + "px";
			//g("divReferenceHeadline").style.height = g("MainImage").offsetHeight + p(jsRF * 0) + "px";

}
function setContent() {
	
	if(g('divBoxCenterTextMaster')){	
			g("divBoxCenterTextMaster").style.left = rxpos('Site') + p(jsRF * 740) + "px";
			g("divBoxCenterTextMaster").style.top = rypos('MainImage') - p(jsRF * 0) + "px";
			g("divBoxCenterTextMaster").style.width = p(jsRF * 240)+ 1 + "px";
			g("divBoxCenterTextMaster").style.height = g("MainImage").offsetHeight - p(jsRF * 18) + "px";
			//g("divBoxCenterTextMaster").style.filter = "alpha(opacity=90);";
			//g("divBoxCenterTextMaster").style.MozOpacity  = 0.9;
			g("divBoxCenterTextMaster").style.border = "0px"
			//g("divBoxCenterTextMaster").style.border = "#a6a9aa 1px solid";
			
			g("divBoxCenterTextDocument").style.marginTop = "0px"
			

			g("divBoxCenterTextDocument").style.width =  p(jsRF * 214) + "px";
			//g("divBoxCenterTextDocument").style.margin-top = "0" ;
	
					if(g('imgArrowScrolbarBoxCenterUp') && g("imgArrowScrolbarBoxCenterDown") ){	
							g("imgArrowScrolbarBoxCenterUp").style.left = rxpos("divBoxCenterTextMaster") + g("divBoxCenterTextMaster").offsetWidth + jsRF*5 - g("imgArrowScrolbarBoxCenterUp").offsetWidth /2 + "px";
							g("imgArrowScrolbarBoxCenterUp").style.top  = rypos("divBoxCenterTextMaster") + p(jsRF * 0) + "px";
					
					
							g("imgArrowScrolbarBoxCenterDown").style.left = rxpos("imgArrowScrolbarBoxCenterUp") + "px";
							g("imgArrowScrolbarBoxCenterDown").style.top  = rypos("divBoxCenterTextMaster") + g("divBoxCenterTextMaster").offsetHeight - g("imgArrowScrolbarBoxCenterDown").offsetHeight - p(jsRF * 10)+ "px";
					}
			
			}
		if(g('divScrollbarBoxCenter')){		
				g("divScrollbarBoxCenter").style.left   = rxpos("imgArrowScrolbarBoxCenterUp") + g("imgArrowScrolbarBoxCenterUp").offsetWidth/2 + "px";
				g("divScrollbarBoxCenter").style.top    = rypos("imgArrowScrolbarBoxCenterUp") + jsRF*10 + "px";
				g("divScrollbarBoxCenter").style.height = rypos("imgArrowScrolbarBoxCenterDown") - g("imgArrowScrolbarBoxCenterDown").offsetHeight + jsRF*2 - rypos("divScrollbarBoxCenter") + "px";
		}
	
		if(g('divScrollSliderBoxCenter')){	
				g("divScrollSliderBoxCenter").style.top = rypos("divScrollbarBoxCenter")+ "px";
				g("divScrollSliderBoxCenter").style.left = rxpos("divScrollbarBoxCenter") - g("divScrollSliderBoxCenter").offsetWidth/2 + "px";				
		}
	
/*
if (isM == false)
{
		if (scrollerBoxCenter == null)
		{
			scrollerBoxCenter = new textScroller(1);
		}
		scrollerBoxCenter.masterobj = 'divBoxCenterTextMaster';
		scrollerBoxCenter.scrollerobj = 'divBoxCenterTextDocument';
		scrollerBoxCenter.scrollbar = 'divScrollbarBoxCenter';
		scrollerBoxCenter.arrowobj = 'divScrollSliderBoxCenter'; //fake shit
		scrollerBoxCenter.scrollslider = 'divScrollSliderBoxCenter';
		scrollerBoxCenter.prepare();	
		if(typeof(arrScrollers) == "object") arrScrollers[arrScrollers.length] = scrollerBoxCenter;
		
		if( g("divBoxCenterTextDocument").offsetHeight < g("divBoxCenterTextMaster").offsetHeight)	{
				g("imgArrowScrolbarBoxCenterUp").style.display = "none";
				g("imgArrowScrolbarBoxCenterDown").style.display = "none";
				g("divScrollbarBoxCenter").style.display = "none";
				g("divScrollSliderBoxCenter").style.display = "none";
			}

} else {
*/

		if( g("divBoxCenterTextDocument").offsetHeight < g("divBoxCenterTextMaster").offsetHeight)
		{
			g("imgArrowScrolbarBoxCenterUp").style.display = "none";
			g("imgArrowScrolbarBoxCenterDown").style.display = "none";
			g("divScrollbarBoxCenter").style.display = "none";
			g("divScrollSliderBoxCenter").style.display = "none";

		} else {

			if (scrollerBoxCenter == null)
			{
				scrollerBoxCenter = new textScroller(1);
			}
			scrollerBoxCenter.masterobj = 'divBoxCenterTextMaster';
			scrollerBoxCenter.scrollerobj = 'divBoxCenterTextDocument';
			scrollerBoxCenter.scrollbar = 'divScrollbarBoxCenter';
			scrollerBoxCenter.arrowobj = 'divScrollSliderBoxCenter'; //fake shit
			scrollerBoxCenter.scrollslider = 'divScrollSliderBoxCenter';
			scrollerBoxCenter.prepare();	
			if(typeof(arrScrollers) == "object") arrScrollers[arrScrollers.length] = scrollerBoxCenter;
		
		}

//} // isM
	
}	
function setContentsearchresult() {
	
	if(g('divBoxCenterTextMaster')){
		

			g("divBoxCenterTextMaster").style.left =  rxpos('Site')+ p(jsRF * 60) + "px";
			g("divBoxCenterTextMaster").style.top = rypos('Site')+ p(jsRF * 170) + "px";
			
			g("divBoxCenterTextMaster").style.width = p(jsRF * 659) + "px";
			g("divBoxCenterTextMaster").style.height = p(jsRF * 378) + "px";
			
			//g("divBoxCenterTextMaster").style.filter = "alpha(opacity=90);";
			//g("divBoxCenterTextMaster").style.MozOpacity  = 0.9;
			//g("divBoxCenterTextMaster").style.border = "1px"
			g("divBoxCenterTextMaster").style.border = "#a6a9aa 1px solid";

			g("divBoxCenterTextDocument").style.width =  p(jsRF * 550) + "px";
			g("divBoxCenterTextDocument").style.paddingLeft = p(jsRF * 35) + "px";
	
					if(g('imgArrowScrolbarBoxCenterUp') && g("imgArrowScrolbarBoxCenterDown") ){	
							g("imgArrowScrolbarBoxCenterUp").style.left = rxpos("divBoxCenterTextMaster") + g("divBoxCenterTextMaster").offsetWidth - jsRF*10 - g("imgArrowScrolbarBoxCenterUp").offsetWidth /2 + "px";
							g("imgArrowScrolbarBoxCenterUp").style.top  = rypos("divBoxCenterTextMaster") + p(jsRF * 30) + "px";
					
					
							g("imgArrowScrolbarBoxCenterDown").style.left = rxpos("imgArrowScrolbarBoxCenterUp") + "px";
							g("imgArrowScrolbarBoxCenterDown").style.top  = rypos("divBoxCenterTextMaster") + g("divBoxCenterTextMaster").offsetHeight - g("imgArrowScrolbarBoxCenterDown").offsetHeight - p(jsRF * 10)+ "px";
					}
			
			}
		if(g('divScrollbarBoxCenter')){		
				g("divScrollbarBoxCenter").style.left   = rxpos("imgArrowScrolbarBoxCenterUp") + g("imgArrowScrolbarBoxCenterUp").offsetWidth/2 + "px";
				g("divScrollbarBoxCenter").style.top    = rypos("imgArrowScrolbarBoxCenterUp") + jsRF*10 + "px";
				g("divScrollbarBoxCenter").style.height = rypos("imgArrowScrolbarBoxCenterDown") - g("imgArrowScrolbarBoxCenterDown").offsetHeight + jsRF*2 - rypos("divScrollbarBoxCenter") + "px";
		}
	
		if(g('divScrollSliderBoxCenter')){	
				g("divScrollSliderBoxCenter").style.top = rypos("divScrollbarBoxCenter")+ "px";
				g("divScrollSliderBoxCenter").style.left = rxpos("divScrollbarBoxCenter") - g("divScrollSliderBoxCenter").offsetWidth/2 + "px";				
		}
	
	
		if (scrollerBoxCenter == null)
		{
			scrollerBoxCenter = new textScroller(1);
		}
		scrollerBoxCenter.masterobj = 'divBoxCenterTextMaster';
		scrollerBoxCenter.scrollerobj = 'divBoxCenterTextDocument';
		scrollerBoxCenter.scrollbar = 'divScrollbarBoxCenter';
		scrollerBoxCenter.arrowobj = 'divScrollSliderBoxCenter'; //fake shit
		scrollerBoxCenter.scrollslider = 'divScrollSliderBoxCenter';
		scrollerBoxCenter.prepare();
		if(typeof(arrScrollers) == "object") arrScrollers[arrScrollers.length] = scrollerBoxCenter;
		if( g("divBoxCenterTextDocument").offsetHeight < g("divBoxCenterTextMaster").offsetHeight)
		{
				g("imgArrowScrolbarBoxCenterUp").style.display = "none";
				g("imgArrowScrolbarBoxCenterDown").style.display = "none";
				g("divScrollbarBoxCenter").style.display = "none";
				g("divScrollSliderBoxCenter").style.display = "none";
		}


	
}	

function setContentNews() {
	
	if(g('divBoxCenterTextMaster')){
		

			g("divBoxCenterTextMaster").style.left =  rxpos('Site')+ p(jsRF * 60) + "px";
			g("divBoxCenterTextMaster").style.top = rypos('Site')+ p(jsRF * 170) + "px";
			
			g("divBoxCenterTextMaster").style.width = p(jsRF * 659) + "px";
			g("divBoxCenterTextMaster").style.height = p(jsRF * 378) + "px";
			
			//g("divBoxCenterTextMaster").style.filter = "alpha(opacity=90);";
			//g("divBoxCenterTextMaster").style.MozOpacity  = 0.9;
			//g("divBoxCenterTextMaster").style.border = "1px"
			g("divBoxCenterTextMaster").style.border = "#a6a9aa 1px solid";

			//g("divBoxCenterTextDocument").style.width =  p(jsRF * 400) + "px";
			g("divBoxCenterTextDocument").style.width =  p(jsRF * 580) + "px";
			g("divBoxCenterTextDocument").style.paddingLeft = p(jsRF * 35) + "px";
	
					if(g('imgArrowScrolbarBoxCenterUp') && g("imgArrowScrolbarBoxCenterDown") ){	
							g("imgArrowScrolbarBoxCenterUp").style.left = rxpos("divBoxCenterTextMaster") + g("divBoxCenterTextMaster").offsetWidth - jsRF*10 - g("imgArrowScrolbarBoxCenterUp").offsetWidth /2 + "px";
							g("imgArrowScrolbarBoxCenterUp").style.top  = rypos("divBoxCenterTextMaster") + p(jsRF * 30) + "px";
					
					
							g("imgArrowScrolbarBoxCenterDown").style.left = rxpos("imgArrowScrolbarBoxCenterUp") + "px";
							g("imgArrowScrolbarBoxCenterDown").style.top  = rypos("divBoxCenterTextMaster") + g("divBoxCenterTextMaster").offsetHeight - g("imgArrowScrolbarBoxCenterDown").offsetHeight - p(jsRF * 10)+ "px";
					}
			
			}
		if(g('divScrollbarBoxCenter')){		
				g("divScrollbarBoxCenter").style.left   = rxpos("imgArrowScrolbarBoxCenterUp") + g("imgArrowScrolbarBoxCenterUp").offsetWidth/2 + "px";
				g("divScrollbarBoxCenter").style.top    = rypos("imgArrowScrolbarBoxCenterUp") + jsRF*10 + "px";
				g("divScrollbarBoxCenter").style.height = rypos("imgArrowScrolbarBoxCenterDown") - g("imgArrowScrolbarBoxCenterDown").offsetHeight + jsRF*2 - rypos("divScrollbarBoxCenter") + "px";
		}
	
		if(g('divScrollSliderBoxCenter')){	
				g("divScrollSliderBoxCenter").style.top = rypos("divScrollbarBoxCenter")+ "px";
				g("divScrollSliderBoxCenter").style.left = rxpos("divScrollbarBoxCenter") - g("divScrollSliderBoxCenter").offsetWidth/2 + "px";				
		}
	
	
		if (scrollerBoxCenter == null)
		{
			scrollerBoxCenter = new textScroller(1);
		}
		scrollerBoxCenter.masterobj = 'divBoxCenterTextMaster';
		scrollerBoxCenter.scrollerobj = 'divBoxCenterTextDocument';
		scrollerBoxCenter.scrollbar = 'divScrollbarBoxCenter';
		scrollerBoxCenter.arrowobj = 'divScrollSliderBoxCenter'; //fake shit
		scrollerBoxCenter.scrollslider = 'divScrollSliderBoxCenter';
		scrollerBoxCenter.prepare();
		if(typeof(arrScrollers) == "object") arrScrollers[arrScrollers.length] = scrollerBoxCenter;
		if( g("divBoxCenterTextDocument").offsetHeight < g("divBoxCenterTextMaster").offsetHeight)
		{
				g("imgArrowScrolbarBoxCenterUp").style.display = "none";
				g("imgArrowScrolbarBoxCenterDown").style.display = "none";
				g("divScrollbarBoxCenter").style.display = "none";
				g("divScrollSliderBoxCenter").style.display = "none";
		}


	
}	

function setupScrollbar(objScrollbar, strUniqueId)
{

	if (
			g('divMaster' + strUniqueId) == null
			|| g('divDocument' + strUniqueId) == null
			|| g("imgArrowScrolbar" + strUniqueId + "Up") == null
			|| g("imgArrowScrolbar" + strUniqueId + "Down") == null
			|| g("divScrollbar" + strUniqueId) == null
			|| g("divScrollSlider" + strUniqueId) == null
		)
	{
		// things are missing
		//alert("somthing missing... " + strUniqueId);
		return;
	}


	if(g('divDocument' + strUniqueId).offsetHeight > g('divMaster' + strUniqueId).offsetHeight)
	{
		if ( g("imgArrowScrolbar" + strUniqueId + "Up") && g("imgArrowScrolbar" + strUniqueId + "Down") && g("divScrollbar" + strUniqueId) && g("divScrollSlider" + strUniqueId) )
		{
			g("imgArrowScrolbar" + strUniqueId + "Up").style.left = rxpos("divMaster" + strUniqueId) + g("divMaster" + strUniqueId).offsetWidth - jsRF*10 - g("imgArrowScrolbar" + strUniqueId + "Up").offsetWidth /2 + "px";
			g("imgArrowScrolbar" + strUniqueId + "Up").style.top  = rypos("divMaster" + strUniqueId) + p(jsRF * 30) + "px";

			g("imgArrowScrolbar" + strUniqueId + "Down").style.left = rxpos("imgArrowScrolbar" + strUniqueId + "Up") + "px";
			g("imgArrowScrolbar" + strUniqueId + "Down").style.top  = rypos("divMaster" + strUniqueId) + g("divMaster" + strUniqueId).offsetHeight - g("imgArrowScrolbar" + strUniqueId + "Down").offsetHeight - p(jsRF * 10)+ "px";

			g("divScrollbar" + strUniqueId).style.left   = rxpos("imgArrowScrolbar" + strUniqueId + "Up") + g("imgArrowScrolbar" + strUniqueId + "Up").offsetWidth/2 + "px";
			g("divScrollbar" + strUniqueId).style.top    = rypos("imgArrowScrolbar" + strUniqueId + "Up") + jsRF*10 + "px";
			g("divScrollbar" + strUniqueId).style.height = rypos("imgArrowScrolbar" + strUniqueId + "Down") - g("imgArrowScrolbar" + strUniqueId + "Down").offsetHeight + jsRF*2 - rypos("divScrollbar" + strUniqueId) + "px";

			g("divScrollSlider" + strUniqueId).style.top = rypos("divScrollbar" + strUniqueId)+ "px";
			g("divScrollSlider" + strUniqueId).style.left = rxpos("divScrollbar" + strUniqueId) - g("divScrollSlider" + strUniqueId).offsetWidth/2 + "px";				
		}

		if (objScrollbar == null)
		{
			objScrollbar = new textScroller(intScrollerCounter++);
		}
		objScrollbar.masterobj = 'divMaster' + strUniqueId;
		objScrollbar.scrollerobj = 'divDocument' + strUniqueId;
		objScrollbar.scrollbar = 'divScrollbar' + strUniqueId;
		objScrollbar.arrowobj = 'divScrollSlider' + strUniqueId; //fake shit
		objScrollbar.scrollslider = 'divScrollSlider' + strUniqueId;
		objScrollbar.prepare();	
		if(typeof(arrScrollers) == "object") arrScrollers[arrScrollers.length] = objScrollbar;

		g("divMaster" + strUniqueId).style.visibility = "hidden";
		g("imgArrowScrolbar" + strUniqueId + "Up").style.visibility = "hidden";
		g("imgArrowScrolbar" + strUniqueId + "Down").style.visibility = "hidden";
		g("divScrollbar" + strUniqueId).style.visibility = "hidden";
		g("divScrollSlider" + strUniqueId).style.visibility = "hidden";
	}

}









function locate(obj,do_not_replace_existing_locations)
{
	if (typeof(obj) != "string")
	{
		alert("Please send ID as string and not object.")
		return;
	}

	objID = obj;
	obj = g(obj);

	if (!obj)
	{
		alert("No luck finding object with ID: " + objID);
	} else {
		show_cross   = 0;
		show_box     = 1;
		flash_border = 1;
		flash_speed  = 500;

		cross_x_size = 2;
		cross_y_size = 2;
		box_x_size   = 2;
		box_y_size   = 2;

		x = rxposObj(obj);
		y = ryposObj(obj);
		document.title = "Last coordinates - x: " + x + ", y: " + y;

		
		ranX1 = ranY1 = ranX2 = ranY2 = "";
		if (do_not_replace_existing_locations)
		{
			ranX1 = "_" + ("" + Math.random()).substring(2);
			ranY1 = "_" + ("" + Math.random()).substring(2);
			ranX2 = "_" + ("" + Math.random()).substring(2);
			ranY2 = "_" + ("" + Math.random()).substring(2);
		}

		if (show_cross == 1)
		{
			createLine( rxposObj(obj) + obj.offsetWidth/2,0,cross_x_size,screen.availHeight,"ff0000",999,"locate-x-line" + ranX1);
			createLine(0,ryposObj(obj) + obj.offsetHeight/2,screen.availWidth,cross_y_size,"ff0000",999,"locate-y-line"  + ranY1);
		}


		if (show_box == 1)
		{
			var left   = rxpos(objID);
			var right  = left + g(objID).offsetWidth;
			var top    = rypos(objID);
			var bottom = top + g(objID).offsetHeight;

			/*
			if (left - right < 5)
			{
				left += - 5;
				right -= - 5;
			}

			if (bottom - top < 5)
			{
				bottom += 5;
				top -= 5;
			}
			*/

			createLine(left,top,box_y_size,bottom-top,"ff0000",999,"x1"    +ranX1);
			createLine(left,top,right-left,box_x_size,"ff0000",999,"y1"    +ranY1);
			createLine(right,top,box_y_size,bottom-top,"ff0000",999,"x2"   +ranX2);
			createLine(left,bottom,right-left+2,box_x_size,"ff0000",999,"y2" +ranY2);
		}

		if (show_box == 1 & flash_border == 1)
		{
			setInterval('g("x1' + ranX1 + '").style.display = (g("x1' + ranX1 + '").style.display == "none")?"block":"none"; g("y1' + ranY1 + '").style.display = g("x2' + ranX2 + '").style.display = g("y2' + ranY2 + '").style.display = g("x1' + ranX1 + '").style.display;', flash_speed + (Math.random()*flash_speed));
		}

	}
	
}