
function KEYPUBLISHER_Adminbar_getWidth()
{if(document.documentElement.clientWidth==0)
return document.body.clientWidth+"px";else
return document.documentElement.clientWidth+"px";}
var locationbar='no';var ref=0;function setref(s){ref=s;}
var MSIE=(navigator.userAgent.indexOf('MSIE')>=0&&navigator.userAgent.indexOf('Win')>=0&&navigator.userAgent.toLowerCase().indexOf('opera')<0)?true:false;var Opera=opera=navigator.userAgent.toLowerCase().indexOf('opera')>=0?true:false;var navigatorVersion=navigator.appVersion.replace(/.*?MSIE (\d\.\d).*/g,'$1')/1;function rand(){return new String(Math.ceil(Math.random()*200+1));}
function popuperror(){alert("     Du må skru på Javaskript \"Popup\" støtte i nettleseren din"+"\n\n"+"___________________________________________________________"+"\n\n"+"             Informasjon om dette, kan du finne på:"+"\n\n"+"                       www.keyteq.no/kundesenter/popup               "+"\n\n"+"\n\n"+"____________________________________________________________");}
function getY(height){return(screen.height-height)/2;}
function getX(width){return(screen.width-width)/2;}
function openKeyPublisherWindow(url,name,height,width,scroll,toolbar,resize)
{if(scroll)scroll='yes';else scroll='no';if(toolbar)toolbar='yes';else toolbar='no';if(resize)resize='yes';else resize='no';var newwindow=window.open(url,name,'height='+height+', width='+width+', status=no, scrollbars='+scroll+', toolbar='+toolbar+', resizable='+resize+', location='+locationbar+', menubar=no,top='+getY(height)+', left='+getX(width),'true');if(!newwindow){popuperror();}else{if(!newwindow.opener){newwindow.opener=self;}if(window.focus){newwindow.focus();}}}
function customWindow(path,windowname,height,width){openKeyPublisherWindow(path,windowname+ref,height,width,false,false,true);}
function productPopup(popupId,productId,height,width,scrollable,resizeable){openKeyPublisherWindow('/index.php?c_=ShopProductPopupGUI&m_=showPopup&popupId='+popupId+'&productId='+productId,'productPopup'+ref,height,width,scrollable,false,resizeable);}
function customWindowToolbar(path,windowname,height,width){openKeyPublisherWindow(path,windowname+ref,height,width,true,true,true);}
function customWindowResize(path,windowname,height,width){openKeyPublisherWindow(path,windowname+ref,height,width,true,false,true);}
function customWindowScroll(path,windowname,height,width){openKeyPublisherWindow(path,windowname+ref,height,width,true,false,true);}
function getnavipos(){if(typeof window.pageYOffset!='undefined')return pos=window.pageYOffset;else return pos=Math.max(document.body.scrollTop,document.documentElement.scrollTop);}
function phonelistcard(phonelistid){customWindow('/index.php?c_=PhonelistGUI&m_=writeCard&PhonelistGUI_writeCard_0_='+phonelistid,'writecard',200,300);}
function checkUser(){return;script=document.createElement('script');script.setAttribute('src','/checkuser.php');script.setAttribute('language','Javascript');script.setAttribute('type','text/javascript');document.getElementsByTagName('head').item(0).appendChild(script);setTimeout("checkUser()",5000);}
function helpWindow(extraUrl){if(!window.open('http://keypublisher.manual.keyteq.no'+extraUrl,'help','height=500, width=900, scrollbars=yes, status=no, toolbar=no, resizable=yes, location='+locationbar+', menubar=no,top=70, left=20','true'))popuperror();}
function runGraph(chart,xml,width,height,http)
{document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+http+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+width+'" HEIGHT="'+height+'" ALIGN=""  id="charts">');document.write('<PARAM NAME=movie VALUE="/executable/fusion_charts/'+chart+'">');document.write('<PARAM NAME="FlashVars" VALUE="&dataXML='+xml+'&chartWidth='+width+'&chartHeight='+height+'">');document.write('<PARAM NAME="quality" VALUE="high">');document.write('<PARAM NAME="bgcolor" VALUE="#FAFAFA">');document.write('<PARAM NAME="wmode" VALUE="transparent">');document.write('<EMBED src="/executable/fusion_charts/'+chart+'" FlashVars="&dataXML='+xml+'&chartWidth='+width+'&chartHeight='+height+'" quality="high" bgcolor=#FAFAFA" wmode="transparent"  WIDTH="'+width+'" HEIGHT="'+height+'" NAME="charts" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="'+http+'://www.macromedia.com/go/getflashplayer"></EMBED>');document.write('</OBJECT>');}
(function($)
{$.fn.jCarousel=function(o){if(window.carousels==undefined)
window.carousels=new Array();return $(this).each(function(index,elem)
{var carousel=new Object();carousel.parent=elem;carousel.originalIndex=index;var $children=$('div',elem);if($children.size()>0){carousel.children=$children;}
carousel.delay=4000;carousel.width=$(elem).css('width');carousel.length=$children.size();carousel.startPos=0;carousel.currentPos=0;carousel.previousPos=0;carousel.endPos=(carousel.length-1);carousel.slidewidth=634;carousel.next=function(){if(this.currentPos<this.endPos){this.previousPos=this.currentPos;++this.currentPos;this.beforeStart();$(this.parent).animate({'left':-(this.currentPos*this.slidewidth)+'px'});this.afterFinish();}else return false;};carousel._canSlideNext=function()
{if(this.currentPos<this.endPos)
return true;else
return false;};carousel.prev=function(){if(this.currentPos>this.startPos){this.previousPos=this.currentPos;--this.currentPos;this.beforeStart();$(this.parent).animate({'left':(this.currentPos*this.slidewidth)+'px'});this.afterFinish();}else return false;};carousel._canSlidePrev=function()
{if(this.currentPos>this.startPos)
return true;else
return false;};carousel.gotoStart=function(){this.previousPos=this.currentPos;this.currentPos=this.startPos;this.beforeStart();$(this.parent).animate({'left':this.startPos+'px'});this.afterFinish();};carousel.startAuto=function(delay){if(delay!=undefined)
var delay=delay;else
var delay=this.delay;var self=this;this.animation=setInterval(function()
{if(self._canSlideNext())
self.next();else self.gotoStart();},delay);};carousel.stop=function(){clearInterval(this.animation);};carousel.beforeStart=function(){if(o!=undefined)
if(o.beforeStart!=undefined)
o.beforeStart(this);};carousel.afterFinish=function(){if(o!=undefined)
if(o.afterFinish!=undefined)
o.afterFinish(this);};if(o!=undefined){if(o.delay!=undefined&&typeof o.delay=='number')
carousel.delay=o.delay;if(o.autoStart!=undefined&&o.autoStart==true)
carousel.startAuto();}
window.carousels.push(carousel);});};})(jQuery);var shipping=function(obj)
{this.initialize(obj);}
shipping.prototype={initialize:function(obj)
{var self=this;this.obj=obj;if($(this.obj.postoppkrav).size()>0){this.setObserver2();}else{this.setObserver1();}},setObserver1:function(){var self=this;if(window.currentShipping!=0){if(window.currentShipping!=200){$(this.obj.normalDelivery).click(function(){$(self.obj.shippingfeeLine).html(window.shippingCost[0]);$(self.obj.orderSumLine).html(window.totalCost[0]);});$(this.obj.terminalDelivery).click(function(){$(self.obj.shippingfeeLine).html(window.shippingCost[1]);$(self.obj.orderSumLine).html(window.totalCost[1]);});}else{$(this.obj.normalDelivery).click(function(){$(self.obj.shippingfeeLine).html(window.shippingCost[6]);$(self.obj.orderSumLine).html(window.totalCost[0]);});$(this.obj.terminalDelivery).click(function(){$(self.obj.shippingfeeLine).html(window.shippingCost[4]);$(self.obj.orderSumLine).html(window.totalCost[1]);});}}},setObserver2:function(){var self=this;if(window.currentShipping==0){$(this.obj.dibs).click(function(){$(self.obj.shippingfeeLine).html(window.shippingCost[4]);$(self.obj.orderSumLine).html(window.totalCost[4]);});$(this.obj.postoppkrav).click(function(){$(self.obj.shippingfeeLine).html(window.shippingCost[3]);$(self.obj.orderSumLine).html(window.totalCost[3]);});}else{$(this.obj.dibs).click(function(){$(self.obj.shippingfeeLine).html(window.shippingCost[5]);$(self.obj.orderSumLine).html(window.totalCost[4]);});$(this.obj.postoppkrav).click(function(){$(self.obj.shippingfeeLine).html(window.shippingCost[2]);$(self.obj.orderSumLine).html(window.totalCost[3]);});}}};$(document).ready(function()
{if($('#cart').size()>0){new shipping({shippingfeeLine:'#shippingfeeLine',orderSumLine:'#orderSumLine',sumCount:'#sumCount',dibs:'#dibs',postoppkrav:'#postoppkrav',normalDelivery:'#normalDelivery',normalDeliveryPrice:'#normalDeliveryPrice',terminalDelivery:'#terminalDelivery',terminalDeliveryPrice:'#terminalDeliveryPrice',});}});$(function()
{$("#tabs li").hover(function()
{$(this).find('ul').show().css('visibility','visible');},function()
{$(this).find('ul').hide().css('visibility','hidden');});var sortableSelector=$('select#sortableProductSelector');if(sortableSelector.length>0)
{sortableSelector.change(function(){window.location.href=this.value;});}
if(parseInt(window.carouselsDelay)>0)
var carouselsDelay=window.carouselsDelay;else
var carouselsDelay=4000;$('.carouselSlides').jCarousel({beforeStart:function(carouselObj){var $titles=$('h2.carouselHeaders span.title');$titles.eq(carouselObj.previousPos).fadeOut('fast');$titles.eq(carouselObj.currentPos).fadeIn('fast');},autoStart:true,delay:carouselsDelay});});$(document).ready(function(){$('#productDetailTabsContainer').tabs();});