
		var NN, IE, DOM;

		NN  = (document.layers) ? true : false;
		IE  = (document.all) ? true : false;
		DOM = (navigator.userAgent.toLowerCase().indexOf('gecko') != -1 && document.getElementById) ? true : false;


		arSites = ["arla","/koola","arlafoods","/storkok","/butik"]


		function pop() {

			var x,y,i,n,ydiff,dy;

            if(NN) {
                y = document.siteMeny.y + (document.siteMeny.clip.height - 1)
                x = document.siteMeny.x
            }
            if(IE) {
                y = document.all.siteMeny.offsetTop + document.all.siteMeny.clientHeight - 3
                x = document.all.siteMeny.offsetLeft
            }
            if(DOM) {

                document.getElementById("siteMeny").style.height = 11

                y = parseInt(document.getElementById("siteMeny").style.top) + parseInt(document.getElementById("siteMeny").style.height) + 2;
                x = parseInt(document.getElementById("siteMeny").style.left + 1)
            }

			put ("sitepopup",x,y);

            if(NN) {
                ydiff = document.sitepopup.clip.height + 4
            }
            if(IE) {
                ydiff = document.all.sitepopup.top + 4
            }
            if(DOM) {
                ydiff = document.getElementById("sitepopup").style.top + 4
            }

			if (isVisible("sitepopup")) {
				hide("sitepopup");
				changeHeight("siteMeny",-ydiff);
			} else {
				show("sitepopup");
				changeHeight("siteMeny",ydiff);
			}
			/*
			if (isVisible("sitepopup")) {
				for (i = 0; i < arSites.length; i++) {
					if (document.URL.toString().indexOf(arSites[i])>0) {
						if (NN) {
							document.sitepopup.document.images["pil"+i]. src = "/bilder/b_sitepil.gif";
						} else {
							document.images["pil"+i]. src = "/bilder/b_sitepil.gif";
						}
						for (n = 0; n<i; n++) {
							if (NN) {
								document.sitepopup.document.images["pil"+n].src = "/bilder/b_transp.gif";
							} else {
								document.images["pil"+n].src = "/bilder/b_transp.gif";
							}
						}*/



						/* Ta bort för att visa pratbubbla med texten "Här är du nu!"
						dy = (n > 1 ? n+2 : n+1) * (NN ? document.sitepopup.document.height : document.all.sitepopup.clientHeight) / 5 // Antal rader text i sitepopmenyn
						x = NN ? document.siteMeny.x + document.siteMeny.clip.width : document.all.siteMeny.offsetLeft +  document.all.siteMeny.clientWidth;
						y = NN ? document.sitepopup.y - document.pratbubbla.clip.height + dy : document.all.sitepopup.offsetTop - document.all.pratbubbla.clientHeight + dy;
						put("pratbubbla",x,y);
						*/
					//}
				//}
				/*show("pratbubbla");*/
			//}

		}


/* *** Användbara funktioner *** */


		function show(sObj) {

			var oObj;
			if (NN) {
				oObj = eval('document.layers["' + sObj + '"]');
		    }
			if (IE) {
				oObj = document.all[sObj].style;
			}
			if(DOM) {
			    oObj = document.getElementById(sObj).style;
			}

			oObj.visibility = NN ? "show" : "visible";

		}

		function hide(sObj) {

			var oObj;
		    if (NN) {
				oObj = document.layers[sObj];
		    }
			if (IE) {
				oObj = document.all[sObj].style;

			}
			if(DOM) {
			    oObj = document.getElementById(sObj).style;

			}

			oObj.visibility = NN ? "hide" : "hidden";

		}

/*
*	put(sObj,x,y) - placerar ut ett objekt/lager
*
*
*	usage -	indata är namnet/identiten på ett objekt/lager samt x- och y-koordinat. Objektet placeras ut
* 				vid dessa koordinater.
*
*
*/


		function put(sObj,x,y) {

			if (IE) {
				document.all[sObj].style.left = x;
				document.all[sObj].style.top = y;
			}
			if (NN) {
				document.layers[sObj].left = x;
				document.layers[sObj].top = y;
			}
			if (DOM) {
			    document.getElementById(sObj).style.left = x;
				document.getElementById(sObj).style.top = y;
			}

		}

		function center(sObj) {

            if(NN) {
                 x = (window.innerWidth - document.layers[sObj].width) / 2
                 y = (window.innerHeight - document.layers[sObj].height) / 2
            }

            if(IE) {
                x = (document.body.clientWidth - document.all[sObj].clientWidth) / 2
                y = (document.body.clientHeight - document.all[sObj].clientHeight) / 2
            }

            if(DOM) {
                x = (document.body.clientWidth - document.getElementById(sObj).style.clientWidth) / 2
                y = (document.body.clientHeight - document.getElementById(sObj).style.clientHeight) / 2

            }

			put(sObj,x,y);

		}


		function changeHeight(sObj,addHeight) {

			if (IE) {
				document.all[sObj].style.pixelHeight = document.all[sObj].clientHeight+addHeight;
			}
			if (NN) {
				document.layers[sObj].document.height = document.layers[sObj].clip.height + addHeight;
			}
			if (DOM) {
			    document.getElementById(sObj).style.pixelHeight = document.getElementById(sObj).clientHeight + addHeight;
			}

		}

		function isVisible(sObj) {


			var vis;

			if (IE) {
				vis = document.all[sObj].style.visibility == "visible" ? true : false;
			}
			if (NN) {
				vis = document.layers[sObj].visibility == "show" ? true : false;
			}
            if (DOM) {
                vis = document.getElementById(sObj).style.visibility == "visible" ? true : false;
            }

			return vis;
		}

/*
*	openWin - opens a new window.
*
*	Usage: openWin(url,name,wid,hgt,scroll)
*														url - page to show in popup window
*														name - name for the window, to distinguish the different windows
*														wid - width of the popup window
*														hgt - height of the popup window
*														scroll - scrollbars or not (0 = no scrollbars)
*
*/

		function openWin(url,name,wid,hgt,scroll) {

			var win

			win = window.open(url,name,'width='+wid+',height='+hgt+(scroll>0?',scrollbars=yes':''));
			win.focus()

		}

/*
*   survey - saves user survey to db
*
*   Usage: survey(form_object)
*
*       form_object - the form to be submitted (survey form)
*
*
*/


		function survey(oForm) {

	        openWin('','Survey',268,372);
	        oForm.submit()

	        return false;
        }
