/*    SiteComponents version:    6.8.0.1, tag SC_6_8_0_1, created Fri Aug 20 11:18:33 +0200 2010    Disclaimer        While we make every effort to ensure that this code is fit for its intended    purpose, we make no guarantees as to its functionality. CoreTrek AS will    accept no responsibility for the loss of data or any other damage or    financial loss caused by use of this code.    Copyright        This programming code is copyright of CoreTrek AS. Permission to run this    code is given to approved users of CoreTrek's publishing system CorePublish.        This source code may not be copied, modified or otherwise repurposed for use    by a third party without the written permission of CoreTrek AS.        Contact webmaster@coretrek.com for information.    *//** * Configuration for site components javascript * * Configuration array structure: * {<component>: {<parameter>: value, <parameter>: value, ... }, ...} */var siteComponentsConfig = {        // Configuration for the keyword module.    keywords: {        elements: ['placeholder-content','placeholder-top'],        skiptags: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],        usetooltip: false    }};// Dropdown menu// http://www.makesites.cc/programming/by-makis/simple-drop-down-menu-with-prototype/var DropDownMenu = Class.create();DropDownMenu.prototype = { initialize: function(menuContainer) {     	var menuElement = $A(menuContainer.getElementsByTagName("ul")).first();	menuElement.childElements().each(function(node){		// if there is a submenu		var submenu = $A(node.getElementsByTagName("ul")).first();		if(submenu != null){			// make sub-menu invisible			Element.extend(submenu).setStyle({display: 'none'});			// toggle the visibility of the submenu			node.onmouseover = node.onmouseout = function(){				Element.toggle(submenu);			}		}	});}};// Magic Footer filling remaining space function resize()    {        // Get elements and necessary element heights        var contentDiv = document.getElementById("placeholder-bottom");        var headerDiv = document.getElementById("container");        var headerHeight = headerDiv.offsetHeight;        // Get view height        var viewportHeight = document.getElementsByTagName('body')[0].clientHeight;        contentDiv.style.height = Math.max(viewportHeight - headerHeight,236) + 'px';    }   window.onload = resize;   window.onresize = resize;// Tracking for LiveChatInc      var __lc = {};      __lc.license = 1082167;      __lc.lang = 'no';      (function() {        var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;        lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);      })();/* Campaign switcher frontpage */var currentCampaign = 0;var campaignTimer = 0;function campaignChangeTo(i,stop) {    if (stop) { campaignTimer = -1; }    $$('.campaign-articlelist .list-navigation .pages').each(function(link){        link.down().src = '/themes/nima/images/bullet-inactive.png';    }.bind(this));    $$('.campaign-articlelist li').each(function(campaign){        if (campaign.id == 'campaign-item'+i) {            $('campaignLink'+i).down().src = '/themes/nima/images/bullet-active.png';            campaign.appear({duration: 1.0});        } else {            campaign.fade({duration: 0.8});        }    }.bind(this));    currentCampaign = i;}var campaignCount;function loopCampaigns() {    if (campaignTimer != -1) {        campaignChangeTo((currentCampaign + 1) % campaignCount, false);    }}/* Jobslist switcher */function popJobs() {    $$('.jobslist .tile-content ul').each(function (jobs) {        jobs.childElements().each(function( job ) { job.show(); });        job = jobs.firstDescendant();        Effect.SlideUp(job);        window.setTimeout(function() { jobs.insert(job); } , 1000 );    }.bind(this));}function getUserInfo() {	var url = "/xmlhttprequest.php?service=webuser.getuserinfo";        new Ajax.Request(url, {          method:'get',          onSuccess: function(transport){             var json = transport.responseText.evalJSON();             if (json.company && json.name && json.address) {                 $('company-82').value = json.company;                 $('name-83').value = json.name;                 $('address-84').value = json.address;                 $('zip-85').value = json.zip;                 $('city-86').value = json.city;                 $('email-87').value = json.email;                 $('phone-88').value = json.phone;                 if (json.customer_number > 0) $('member-93').checked = true;             }           }        });}document.observe('dom:loaded', function(){    if($('ctwebform-template-9') != undefined) {        getUserInfo();    }});
