// JavaScript Document





//<![CDATA[
function JSInit() {
{
IV1.Show(IV1.IsViewModeOK());
IV1.Init();


}
{
DADRenderDate('Comp11_DateDisplayer', '%A %#d %B %Y', '');

}
}
//]]>



//<![CDATA[
function JSInit() {
{
IV1.Show(IV1.IsViewModeOK());
IV1.Init();

}
}
//]]>

//<![CDATA[
	function MHGetRef(str)
	{
		if(document.all)
			return document.all[str];
		else
			return document.getElementById(str);
	}

	function MHSwitchImage(strID, strFileName)
	{
		var obj = MHGetRef(strID);
		if(obj == null || obj + "" == "undefined") return;
		obj.src = strFileName;
	}
//]]>


//<![CDATA[

function IV1Res(strFN, strFNT, strN, strD, strA, nW, nH, nWT, nHT, nFS)
{ 
	this.Filename		= strFN;
	this.FilenameThumb	= strFNT;
	this.Name			= strN;
	this.Description	= strD;
	this.Alt			= strA;
	this.Width			= nW;
	this.Height			= nH;
	this.WidthThumb		= nWT;
	this.HeightThumb	= nHT;
	this.Filesize		= nFS;

}

function IV1_C()
{
	this.arrRes					= new Array();
	this.nTimeOutID				= 0;
	this.bSlideShowIsPlaying	= false;
	this.bInitDone				= false;
	this.nImageCurIndex			= 0;

	this.Init = function() 
	{
		this.nImageCurIndex = 0;
		this.SwitchImage();
		this.SlideShowPlay();		
		this.bInitDone = true;
		this.SendAll(this.nChannelID, 1, 0, "");
		document.arrImgIV1 = new Array();
		for(var i = 0; i < this.arrRes.length; ++i) {
			document.arrImgIV1[(i * 2)]		= new Image(); document.arrImgIV1[(i * 2)].src		= this.arrRes[i].Filename;
			document.arrImgIV1[(i * 2) + 1]	= new Image(); document.arrImgIV1[(i * 2) + 1].src	= this.arrRes[i].FilenameThumb;
		}
	}

	this.SendAll = function(nChannel, nMsg, nParam, strParam)
	{
		if(document.ESSIC == null || typeof(document.ESSIC) == "undefined") return false
	
		if(!this.bInitDone && nMsg != 1) return false;
		
		for(var i = 0; i < document.ESSIC.length; ++i) {
			if(document.ESSIC[i] && document.ESSIC[i].OnImageEvent) {
				document.ESSIC[i].OnImageEvent(nChannel, nMsg, nParam, strParam);
			}
		}
		return true;
	}
	this.ImageGetNum = function()			{ return this.arrRes.length; }
	this.ImageGetIndex = function(nIndex)	{ return nIndex < 0 || nIndex >= this.arrRes.length ? null : this.arrRes[nIndex]; }
	this.ImageGetCurIndex = function()		{ return this.nImageCurIndex; }
	this.ImageGetCur = function()			{ return this.ImageGetIndex(this.nImageCurIndex); }
	this.ImageGoto = function(nIndex, bStop)
	{
		if(nIndex < 0 || nIndex >= this.arrRes.length)
			return false;

		this.Show(this.IsViewModeOK());
		var bRender = this.nImageCurIndex != nIndex;
		this.nImageCurIndex = nIndex;
		if(bRender) {
			this.SwitchImage();
		}
		if(bStop) this.SlideShowStop();
		this.SendAll(this.nChannelID, 100, nIndex, "");
	}

	this.ImageGotoRel = function(nSteps, bWrap, bStop)
	{
		var nNewIndex = this.nImageCurIndex + nSteps;

		if(bWrap) {
			if(nNewIndex < 0 || nNewIndex >= this.ImageGetNum() - 1) {
				var bReverse = nSteps < 0;
				nSteps = Math.abs(nSteps);
				var nDiff = nSteps % this.ImageGetNum();

				var nCur = this.nImageCurIndex;				
				for(var i = 0; i < nDiff; ++i) {
					nCur = bReverse ? --nCur : ++nCur;
					if(nCur < 0)					nCur = this.ImageGetNum() - 1;
					if(nCur >= this.ImageGetNum())	nCur = 0;
				}
				nNewIndex = nCur;
			}
		}
		this.ImageGoto(nNewIndex, bStop);
	}
	
	this.IsViewModeOK = function()
	{
		return true;
	}
	this.ImageSetViewMode = function(nMode)
	{
		this.nImageCurViewMode = nMode;
		this.Show(this.IsViewModeOK());
		this.SlideShowStop();
		this.SendAll(this.nChannelID, 200, nMode, nMode == 0 ? "Overview" : "Single");
	}
	this.ImageGetViewMode = function()		{ return this.nImageCurViewMode; }
	this.SlideShowIsWrapping = function()	{ return true; }


	this.SlideShowPlay = function()
	{
		if(this.SlideShowIsPlaying()) return;
		if(this.ImageGetCurIndex() == this.ImageGetNum() - 1 && this.ImageGetNum() > 1) {
			this.ImageGoto(0);		
		}
		this.bSlideShowIsPlaying = true;
		this.nTimeOutID = setTimeout(this.strObjName + ".SlideShowPlayer()", 11000.0000);
		this.SendAll(this.nChannelID, 300, 0, "");
	}

	this.SlideShowStop = function()
	{
		if(!this.SlideShowIsPlaying()) return;
		this.bSlideShowIsPlaying = false;
		clearTimeout(this.nTimeOutID);
		this.nTimeOutID = 0;
		this.SendAll(this.nChannelID, 301, 0, "");
	}

	this.SlideShowIsPlaying = function()		{ return this.bSlideShowIsPlaying; }

	this.SlideShowPlayer = function()
	{
		this.ImageGotoRel(1, true, false);
		this.nTimeOutID = setTimeout(this.strObjName + ".SlideShowPlayer()", 11000.0000);
	}

	this.Show = function(bShow)
	{
		var objDOM = this.GetRef("IV1_container");
		if(objDOM != null && typeof(objDOM) != "undefined" && typeof(objDOM.style) != "undefined") {
			objDOM.style.display = bShow ? "" : "none";
		}
	}
	
	this.SwitchImage = function()
	{
		var objImage = this.ImageGetCur();
		if(objImage == null || typeof(objImage) == "undefined") return;

		var strImageID = "img_" + this.strObjName;
		var obj = this.GetRef(strImageID)
		
		if(obj == null || typeof(obj) == "undefined") return;

		var bIE55 = window.createPopup;
		if(bIE55 && this.strFilter != "") {
			obj.style.filter = this.strFilter;
			for(var i = 0; i < obj.filters.length; ++i)
				obj.filters[i].Apply();    
		}
		obj.src				= objImage.Filename;
		obj.width			= objImage.Width;
		obj.height			= objImage.Height;
		obj.alt				= objImage.Alt;
		obj.title			= objImage.Alt;
		if(bIE55 && this.strFilter != "") {
			for(var i = 0; i < obj.filters.length; ++i)
				obj.filters[i].Play();    
		}
	}
	this.GetRef = function(str)		{ return document.all ? document.all[str] : document.getElementById(str); }
	this.LayerWrite = function(strLayer, strHtml)
	{
		if(document.all) {
			if(document.all[strLayer] != null && typeof(document.all[strLayer]) != "undefined") document.all[strLayer].innerHTML = strHtml;
		} else {
			if(document.getElementById) {
				document.getElementById(strLayer).innerHTML = strHtml;
			} else {
				var obj = document.layers[strLayer].document;
				obj.open();
				obj.write(strHtml);
				obj.close();
			}
		}
	}
}
	IV1 = new IV1_C();
	IV1.arrRes[0] = new IV1Res("img/slide/1a.jpg", "img/slide/1a.jpg", "Euroe Benefit Networks AB", "", "Euroe Benefit Networks AB", 750, 194, 60, 40, 165855); 
	IV1.arrRes[1] = new IV1Res("img/slide/2a.jpg", "img/slide/2a.jpg", "Euroe Benefit Networks AB", "", "Euroe Benefit Networks AB", 750, 194, 60, 40, 338069); 
	IV1.arrRes[2] = new IV1Res("img/slide/4a.jpg", "img/slide/4a.jpg", "Euroe Benefit Networks AB", "", "Euroe Benefit Networks AB", 750, 194, 60, 40, 316513); 
	IV1.arrRes[3] = new IV1Res("img/slide/5a.jpg", "img/slide/5a.jpg", "Euroe Benefit Networks AB", "", "Euroe Benefit Networks AB", 750, 194, 60, 40, 396583); 
	IV1.arrRes[4] = new IV1Res("img/slide/6a.jpg", "img/slide/6a.jpg", "Euroe Benefit Networks AB", "", "Euroe Benefit Networks AB", 750, 194, 60, 40, 364959); 
	IV1.arrRes[5] = new IV1Res("img/slide/7a.jpg", "img/slide/7a.jpg", "Euroe Benefit Networks AB", "", "Euroe Benefit Networks AB", 750, 194, 60, 40, 313730); 
	document.ESSIV1			= IV1;
	IV1.nChannelID			= 1;
	IV1.nImageCurViewMode	= 1;
	IV1.strCompID			= "IV";
	IV1.strObjName			= "IV1";
	IV1.strImageText			= "";
IV1.strFilter = "progid:DXImageTransform.Microsoft.Barn(duration=7.0000,motion=out, orientation=vertical)";
//]]>

<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

//<![CDATA[
	function LOGGetRef(str)
	{
		if(document.all)
			return document.all[str];
		else
			return document.getElementById(str);
	}

	function LOGSwitchImage(strID, strFileName)
	{
		var obj = LOGGetRef(strID);
		if(typeof(obj) + "" == "undefined") return;
		obj.src = strFileName;
	}

	function LOGSendForm(strID, nCheck, strExtension, strObjName)
	{
		var obj = LOGGetRef(strID);
		if(typeof(obj) + "" == "undefined") return;
		var str = obj.value;
		if(str.length > 0) {
			var nTotal = 0;		
			for(var i = 0; i < str.length; ++i) {
				nTotal += str.charCodeAt(i);
			}
			var nHash = nTotal % 49;

			if(nHash == nCheck) {
				eval(strObjName + "Correct('" + str + "." + strExtension + "');");
			} else {
				eval(strObjName + "False();");
			}
		}
	}
	function LOG1False()
	{
		alert("Har du glömt lösenordet? Kontakta oss!");
		return;
	}
	function LOG1Correct(strFilename)
	{
		location.href = strFilename;
	}
//]]>


