<!--
var flashLoaded = false;

function divOver(elem,over) {
	if(over) {
		//elem.className = elem.className + '-active';
		var css = elem.className;			
		if(css != '') elem.className = css.replace('-inactive','-active');
	} else {
		var css = elem.className;			
		if(css != '') elem.className = css.replace('-active','-inactive');
	}
}


function menuOver(id,over) {
    var div = document.getElementById('sub' + id);    
    var img = document.getElementById('img' + id);    
    if(div) {		
		if(over) {
            div.className = div.className + ' active';
            div.style.visibility = 'visible';
            div.style.display = 'block';
            div.style.left = Math.round(img.offsetLeft - 150) + 'px';                                
         } else {
            var style = div.className;
            div.className = style.replace(' active','');
            div.style.visibility = 'hidden';
            div.style.display = 'none';            
        }	
    }    
    
	if(img) {		
		var imgsrc = img.src;
        if(over) {
            img.src = imgsrc.replace('.gif','-active.gif');
        } else {
            img.src = imgsrc.replace('-active.gif','.gif');
        }	
    }        
}


function officeOver(elem,over,image) {
	if(over) {
		if(image) elem.src = 'sites/exact/im/trans.gif';
	} else {
		if(image) elem.src = image;
	}	
}


function prevImage(id) {
    id = id - 1;
    if(id < 0) id = adThmbs.length;
    selectedImageId = id;
	showThmb(id);							
}

function nextImage(id) {
    id = id + 1;
    if(id >= adThmbs.length) id = 0;
    selectedImageId = id;
    showThmb(id);												        
}

function showThmb(id) {    
    var img = document.getElementById('large'); 
    //var thisimg = document.getElementById('thmb' + id); 
	if(img) {
	    var image = adThmbs[id];	
	    if(image) {
	        if(adThmbs.length >= 3) {
	            var prevId = id + 1;
	            var nextId = id - 1;
	            if(nextId < 1)  nextId = adThmbs.length;
	            if(prevId > adThmbs.length) prevId = 0;
	            var prev = adThmbs[prevId-1];
	            var next = adThmbs[nextId-1];
	            //img.src = image.src; 
	            //img.alt = image.alt;
	            
				
					/*bgImage = new Image(); 
					bgImage.src = image.src;
					//alert(heavyImage.src + heavyImage.width);
					
					var w = bgImage.width;
					var h = bgImage.height;
					//alert(bgImage.src + ' width:' + w + ' height:' + h);
							
					if(w > h) {
						bgImage.width = 623 + 'px';
						bgImage.height = 417 + 'px';
					} else {
						bgImage.width =  + 'px';
						bgImage.height = 417 + 'px';
					}	*/
				
				img.style.backgroundImage = "url(" + image.src + ")";	            
	            
	        }						        	        
	    }
	}	
	

}



function adImage(src,alt) {
    this.src = src;
    this.alt = alt;    
}


function showQuickQuote() {
	var response = Exact.Templates.Documents.Quote.QuoteFactory.AjaxQuoteForm();
	var form = document.getElementById('qqform');
	form.innerHTML = response.value;
}


function showOfficeQuote(id, email, topX) {
	var response = Exact.Templates.Documents.Quote.QuoteFactory.AjaxQuoteByOfficeForm(id,email);
		
	var overlay = document.getElementById('overlay');
	overlay.className = 'overlay-on';
	
	var popup = document.getElementById('overlay-content');
	popup.className = 'overlay-content-on';
	popup.style.left = (screenWidth()/2 - 150) + 'px';
	if(topX == '' || topX < 350) topX = 500;	
	popup.style.top = (topX - 0) + 'px';
	popup.innerHTML = response.value;
}

function showCV(id, topX, topY) {
	var cv = document.getElementById(id);
	var overlay = document.getElementById('overlay');
	overlay.className = 'overlay-on';
	var popup = document.getElementById('overlay-content');
	popup.className = 'overlay-content-on';
	popup.style.left = (screenWidth()/2 - 150) + 'px';
	if(topX == '' || topX < 350) topX = 500;	
	popup.style.top = (topX - 0) + 'px';
	popup.innerHTML = cv.innerHTML;
}

function showPropertyInfo(id, topX, topY) {
	var cv = document.getElementById(id);
	var overlay = document.getElementById('overlay');
	overlay.className = 'overlay-on';
	var popup = document.getElementById('overlay-content');
	popup.className = 'overlay-content-on';
	popup.style.left = (screenWidth()/2 - 150) + 'px';
	if(topX == '' || topX < 350) topX = 500;	
	popup.style.top = (topX - 0) + 'px';
	popup.innerHTML = cv.innerHTML;
}


function showTip(topX) {
	var finnkode =  queryString('finnkode') + '';
	var sid = queryString('sid') + '';	
	var response = Exact.Templates.TipFactory.AjaxTipForm(finnkode,sid);		
	var overlay = document.getElementById('overlay');
	overlay.className = 'overlay-on';
	//alert(response.value);
	var popup = document.getElementById('overlay-content');
	popup.className = 'overlay-content-on';
	popup.style.left = (screenWidth()/2 - 150) + 'px';
	if(topX == '' || topX < 350) topX = 500;	
	popup.style.top = (topX - 200) + 'px';
	popup.innerHTML = response.value;	
}

function closeOverlay() {		
	var overlay = document.getElementById('overlay');
	var popup = document.getElementById('overlay-content');

	if(overlay) overlay.className = 'overlay-off';	
	if(popup) popup.className = 'overlay-content-off';	
}

function sendTipsRequest() {
    var name = document.getElementById('name');
    var email = document.getElementById('email');
    var finnkode = document.getElementById('finnkode');
    var sid = document.getElementById('sid');
    var comment = document.getElementById('comment');    
    var response = Exact.Templates.TipFactory.AjaxSendTips(GetActiveMenuId(),GetActiveDocumentId(),finnkode.value, sid.value,name.value,email.value,comment.value);
    var popup = document.getElementById('overlay-content');
	popup.innerHTML = response.value;    
}

function sendQuote() {
	var type = document.getElementById('qtype');
	var name = document.getElementById('qname');
	var addr = document.getElementById('qaddress');
	var postal = document.getElementById('qziparea');
	var email = document.getElementById('qemail');
	var phone = document.getElementById('qphone');
	var office = document.getElementById('qoffice');
	var comment = document.getElementById('qcomment');
	var officerecipient = document.getElementById('qrecipient');
		
	var officeId = 0;
	if(type.value == 'OFFICE') {
		officeId = office.value;
	} else {		
		officeId = office.options[office.selectedIndex].value;
	}
	Exact.Templates.Documents.Quote.QuoteFactory.AjaxSendQuote(type.value, name.value, addr.value,postal.value,email.value,phone.value,officeId, comment.value,officerecipient.value ,responseSendQuote);
}
function responseSendQuote(response) {
	var form1 = document.getElementById('quoteform');
	if(form1) {
		form1.innerHTML = response.value;
	}
}

function checkNumeric(value){
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (anum.test(value))return true;
	return false;    
}


function fixchars(val) {
	return val.replace(/['_,%|`"~#]/g, "");	
}

function GetGuid() {
	return (((1+Math.random())*0x10000)|0).toString(16).substring(1) 
}

function RanNum() {
	var randomnumber=Math.floor(Math.random()*21);
}

function screenWidth() {
    var winW = 840, winH = 460;

	ns4 = (document.layers)? true:false
	ie4 = (document.all)? true:false

	winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20
	winH = (ns4)? window.innerHeight : document.body.offsetHeight

    return winW;
}

function showFullDocument(id, over) {
    var div = document.getElementById('doc' + id);    
    if(div) {		
		if(over) {
		    div.style.visibility = 'visible';
            div.style.display = 'block';            
            //div.style.left = (Math.round((screenWidth()/2) - ((965-1)/2))) + 'px';            
            div.style.left = '0px';// Math.round((screenWidth()-945)/2) + 'px';            
         } else {
            div.style.visibility = 'hidden';
            div.style.display = 'none';            
        }	
    }  	    
}

function nextFullDoc(currentid) {
	showFullDocument(currentid,false);
	var docs = documentIDs();
	var doc = docs.split(',');	
    for(i = 0; i < doc.length; i++) {		
		if('' + currentid == doc[i]) {
			if((i + 1) >= doc.length) {
				showFullDocument(doc[0],true);
			} else {
				showFullDocument(doc[i+1],true);
			}
		}
    }
}

function prevFullDoc(currentid) {
	showFullDocument(currentid,false);
	var docs = documentIDs();
	var doc = docs.split(',');	
    for(i = 0; i < doc.length; i++) {		
		if('' + currentid == doc[i]) {
			if((i - 1) < 0) {
				showFullDocument(doc[doc.length-1],true);
			} else {
				showFullDocument(doc[i-1],true);
			}
		}
    }
}

function queryString(ji) {
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	for (i=0;i<gy.length;i++) {
		ft = gy[i].split("=");
		if (ft[0].toLowerCase() == ji.toLowerCase()) {
			return ft[1];
		}
	}
	return '';
}

//-->