/******************************************************************************
Author:  Joakim Lundberg
******************************************************************************/

var lswww = 
{
quotes : {
		se : [
[unescape('Kombinationen av StatWatch och AddMan Pro har visat sig mycket framg%E5ngsrikt hos oss. Nu har vi en person p%E5 en 75%25 tj%E4nst som hanterar alla externa annonser f%F6r 7 tidningar, n%E5got som inte var m%F6jligt tidigare'), 
	unescape('Marie Kihl - Nya Wermlands Tidning'), 
	'AddMan Pro'], 
[unescape('I v%E5r ateljé producerar vi annonser och sidor, samt sk%F6ter annonskontroll till ett antal olika tidningar, b%E5de dagspress och m%E5nadsmagasin. Laidback Solutions annonskontrollsystem, AddManPro, %E4r s%E5 flexibelt att det klarar all v%E5r preflight av inkommande och utg%E5ende filer. Vi tj%E4nar tid och pengar och kan leverera h%F6gre kvalité %E4n tidigare'), 
	unescape('Per Landon - Annonsservice AB'), 
	'AddMan Pro'], 
[unescape('M%E5nga av momenten i v%E5ra produktionsfl%F6den sk%F6ts via system fr%E5n Laidback. Detta har m%F6jliggjort att vi s%E4kert kunnat hantera 6 ggr s%E5 m%E5nga helmaterial p%E5 h%E4lften av personalstyrkan j%E4mf%F6rt med f%F6r 3 %E5r sedan.'), 
	unescape('Tommy H%E4rkell - Produktionschef, Lokaltidningen Mitt i Stockholm AB'), 
	'AddMan Pro'], 
[unescape('Som forhandler til store og krevende kunder, er vi avhengig av %E5 ha samarbeidspartnere som er profesjonelle og p%E5litelige. Og det har dere til fulle levd opp til.'), 
	unescape('Jan-Erik %D8verg%E5rd – Pressit AS'), 
	'ColorMan'], 
[unescape('Idag anv%E4nder vi FileTrain till en m%E4ngd olika saker, annonsfl%F6de,  skicka f%E4rdiga sidor till tryckeriet, namnbyten p%E5 filer mm. Det automatiserar m%E5nga repetetiva uppgifter hos oss och sparar en massa tid som vi kan l%E4gga p%E5 annat.'), 
	unescape('Glenn Pehrsson / Lokaltidningen Mitt i Stockholm AB'), 
	'FileTrain'], 
[unescape('Med Creole har vi ett system vi har full kontroll %F6ver och trots att det %E4r ett enkelt klient - server baserat system %F6ver internet finns det v%E4ldigt f%E5 begr%E4nsningar vad det g%E4ller layout och produktion av grafiska filer. '), 
	unescape('Tommy H%E4rkell - Produktionschef, Lokaltidningen Mitt i Stockholm AB'), 
	'Creole'], 
[unescape('Laidback har byggt ett program f%F6r databashantering / XML-import till QuarkXPress – ett alldeles briljant litet program som kapar m%E4ngder av tid f%F6r en av v%E5ra katalogproduktioner. Dessutom har Laidback kunskaper om tidningsbranschen, tryck, filformat, f%E4rg m m som %E4r helt unika. V%E5rt samarbete kommer s%E4kert att f%F6rdjupas.'), 
	unescape('Per Landon - Annonsservice AB'), 
	unescape('Tj%E4nster')]
		],
		en : [
[unescape('The combination of StatWatch and AddMan Pro has been very successful at NWT. Today there is one person, working 75%25, handling all the external advertising files for 7 newspapers. This was impossible before we got the system and we are very happy with the system.'), 
	unescape('Marie Kihl - Nya Wermlands Tidning'), 
	'AddMan Pro'], 
[unescape('In our bureau we produce ads and full pages and we also handle preflight for digital ads for a number of newspapers and magazines. The AddMan Pro system from Laidback Solutions is so flexible that it can be used for all the workflows. We save time and money and can deliver a better quality than we could before.'), 
	unescape('Per Landon - Annonsservice AB'), 
	'AddMan Pro'], 
[unescape('Lots of the tasks in our production workflows are run by systems from Laidback. This has made it possible for us to handle about 6 times the amount of files on half the staff we were 3 years ago.'), 
	unescape('Tommy H%E4rkell - Produktionschef, Lokaltidningen Mitt i Stockholm AB'), 
	'AddMan Pro'], 
[unescape('As a reseller to large and demanding customers, we are depending on having partners which are professional and reliable. And you have fulfilled all our demands.'), 
	unescape('Jan-Erik %D8verg%E5rd – Pressit AS'), 
	'ColorMan'], 
[unescape('We use FileTrain to lots of different things, workflow for digital ads, sending full pages to the print house, renaming files and so on. It automates lots of repetitive tasks and saves us a lot of time which is better spent on creative matters.'), 
	unescape('Glenn Pehrsson / Lokaltidningen Mitt i Stockholm AB'), 
	'FileTrain'], 
[unescape('Creole gives us full control of the production workflow and even since it looks like a simple client – server based system over the internet, there are very few limitations regarding layout and production of graphical files.'), 
	unescape('Tommy H%E4rkell - Produktionschef, Lokaltidningen Mitt i Stockholm AB'), 
	'Creole'], 
[unescape('Laidback has developed a solution for database / XML-import for QuarkXPress – a totally brilliant solution which saves us weeks of work for one of our catalogue productions. Besides that, their knowledge about the newspaper business, print, file formats, colours etc. is unique and we will definitely engage them more in the future.'), 
	unescape('Per Landon - Annonsservice AB'), 
	'Services']
		]
},

// Variables
firstPageNewsCount : 11, 
frameID : 'gray-modern-thin', 
frameMiddleBG : 'http://www.laidbacksolutions.se/common/images/boxBG.png', 
quotationInSteps : 100, //Number of steps for the incoming quote's transition
quotationInDuration : 1000, //Milliseconds for the incoming quote's transition
quotationOutSteps : 100, //Number of steps for the incoming quote's transition
quotationOutDuration : 800, //Milliseconds for the incoming quote's transition
quotationDuration : 15000, //Milliseconds for the quote to stay 
safari : /Safari/.test(navigator.userAgent),
strLangID : 'se', 
ie : (document.all && !window.opera),
strPrefix : '', 
locStart : '', 
locEnd : '', 
strPrefixLang : '', 
headLoaded : false, 
strSP : String.fromCharCode(160), 
strSpacer : String.fromCharCode(160)+String.fromCharCode(160)+String.fromCharCode(160)+'|'+String.fromCharCode(160)+String.fromCharCode(160)+String.fromCharCode(160),
zIndexCounter : 1001, // adjust to other absolutely positioned elements 
elDebug: null, 
newsViewer : null,  
// Language strings
lang : {
	en :
	{
		navigationAbout : 'About', 
		navigationHome : 'Home', 
		navigationServices : 'Services', 
		navigationProducts : 'Products', 
		navigationResellers : 'Resellers', 
		navigationNews : 'News', 
		austria : 'Austria', 
		australia : 'Australia', 
		brazil : 'Brazil', 
		canada : 'Canada', 
		customerQuotes : 'Customer quotes', 
		customers : 'Customers', 
		denmark : 'Denmark', 
		documents : 'Documents', 
		download : 'Download', 
		faq : 'FAQ', 
		features : 'Features', 
		finland : 'Finland', 
		france : 'France', 
		germany : 'Germany', 
		ireland : 'Ireland', 
		israel : 'Israel', 
		italy : 'Italy', 
		menu : 'menu', 
		moreInformation : 'More information', 
		netherland : 'Netherland', 
		newsArchive : 'News archive', 
		norway : 'Norway', 
		productShortDescaddmanpro : 'Client to monitor the workflow and individual files.', 
		productShortDesccreole : 'Web2Print solution for creating digital content through the web browser.', 
		productShortDescfiletrain : 'Handles your digital workflow, scanning emails, FTP servers and local folders.', 
		selectCountry : 'Select country', 
		southAfrica : 'South Africa', 
		spain : 'Spain', 
		sweden : 'Sweden', 
		thailand : 'Thailand', 
		uk : 'UK', 
		versionHistory : 'Version notes' 
	}, 
	se : 
	{
		/* å=%E5 ä=%E4 ö=%F6 Å=%C5 Ä=%C4 Ö=%D6 Ø=%D8*/ 
		navigationAbout : unescape('Om oss'), 
		navigationHome : unescape('F%F6rsta sidan'), 
		navigationServices : unescape('Tj%E4nster'), 
		navigationProducts : unescape('Produkter'), 
		navigationResellers : unescape('%C5terf%F6rs%E4ljare'), 
		navigationNews : unescape('Nyheter'), 
		austria : unescape('%D6sterrike'), 
		australia : 'Australien', 
		brazil : 'Brasilien', 
		canada : 'Kanada', 
		customerQuotes : unescape('Sagt om Laidback'), 
		customers : unescape('Kunder'), 
		denmark : 'Danmark', 
		documents : 'Dokument', 
		download : unescape('Ladda ner'), 
		faq : unescape('FAQ'), 
		features : unescape('Sammanfattning'), 
		finland : 'Finland', 
		france : 'Frankrike', 
		germany : 'Tyskland', 
		ireland : 'Irland', 
		israel : 'Israel', 
		italy : 'Italien', 
		menu : unescape('meny'), 
		moreInformation : unescape('Mer information'), 
		netherland : 'Holland', 
		newsArchive : 'Nyhetsarkiv', 
		norway : 'Norge', 
		productShortDescaddmanpro : unescape('Kontrollerar filer och arbetsfl%F6de.'), 
		productShortDesccreole : unescape('Web2Print-l%F6sning f%F6r att skapa digitalt material via en vanlig webbl%E4sare.'), 
		productShortDescfiletrain : unescape('Automatiserar mottagning och sortering av digitalt material.'), 
		selectCountry : unescape('V%E4lj land'), 
		southAfrica : 'Sydafrika', 
		spain : 'Spanien', 
		sweden : 'Sverige', 
		thailand : 'Thailand', 
		uk : 'England', 
		versionHistory : unescape('Versionshistoria')
	}
},

// Methods
createElement : function (tag, attribs, styles, parent, nopad, strClass) 
{
	var el = document.createElement(tag);
	if(attribs) 
	{
		lswww.setAttribs(el, attribs);
	}
	if(nopad) 
	{
		lswww.setStyles(el, {padding: 0, border: 'none', margin: 0});
	}
	if(styles) 
	{
		lswww.setStyles(el, styles);
	}
	if(parent) 
	{
		parent.appendChild(el);	
	}
	if(strClass) 
	{
		el.className = strClass;	
	}
	return el;
},


createFrame : function(el)
{
	new lswww.Outline(el, lswww.frameID);
}, 


createHeader : function()
{
	lswww.headLoaded = false;
	new lswww.Header();
}, 

createNavigationLink : function(parent, strHREF, elLink, strClass)
{
	var elA = lswww.createElement('a', null, null, parent, false, strClass);
	elA.href = strHREF;
	if(elLink) 
	{
		elA.appendChild(elLink);
	}
	return elA;
},

createProductNavigationTable : function(strProduct)
{
	new lswww.ProductNavigator(strProduct);	
}, 

discardElement : function(d) 
{
	lswww.garbageBin.appendChild(d);
	lswww.garbageBin.innerHTML = '';
},

getPosition : function(el)	
{
	var p = { x: el.offsetLeft, y: el.offsetTop };

	while (el.offsetParent)	{
		el = el.offsetParent;
		p.x += el.offsetLeft ? el.offsetLeft : 0;
		p.y += el.offsetTop ? el.offsetTop : 0;
		if (el != document.body && el != document.documentElement) {
			p.x -= el.scrollLeft;
			p.y -= el.scrollTop;
		}
	}
	return p;
},

getText : function(strID)
{
	return lswww.lang[lswww.strLangID][strID];
}, 

getTextNode : function(strID)
{
	var el = document.createTextNode(lswww.getText(strID));
	return el;
},

init : function (iSubSteps) 
{
	for(i=0; i<iSubSteps; i++)
	{
		lswww.strPrefix += '../';
		if(i>0)
		{
			lswww.strPrefixLang += "../";
		}
	}
	if (!lswww.container) 
	{
		lswww.container = lswww.createElement('div', null, 
			{ position: 'absolute', left: 0, top: 0, width: '100%', zIndex: lswww.zIndexCounter }, 
			document.body,
			true);
		lswww.garbageBin = lswww.createElement('div', null, { display: 'none' }, lswww.container);

		// http://www.robertpenner.com/easing/ 
		Math.easeInOutQuad = function (t, b, c, d) 
		{
			if ((t/=d/2) < 1) 
			{
				return c/2*t*t + b;
			}
			return -c/2 * ((--t)*(t-2) - 1) + b;
		};
		Math.easeInElastic = function (t, b, c, d, a, p) 
		{
			var s;
			if (t===0) 
			{
				return b;  
			}
			if ((t/=d)==1) 
			{
				return b+c;  
			}
			if (!p) 
			{
				p=d*0.3;
			}
			if (a < Math.abs(c)) 
			{ 
				a=c; 
				s=p/4; 
			}
			else 
			{
				s = p/(2*Math.PI) * Math.asin (c/a);
			}
			return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		};	
		Math.easeOutElastic = function (t, b, c, d, a, p) 
		{
			var s;
			if (t===0) 
			{
				return b;  
			}
			if ((t/=d)==1) 
			{
				return b+c; 
			}
			if (!p) 
			{
				p=d*0.3;
			}
			if (a < Math.abs(c)) 
			{ 
				a=c; 
				s=p/4; 
			}
			else 
			{
				s = p/(2*Math.PI) * Math.asin (c/a);
			}
			return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
		};
	}
	var loc = window.location.href,
	locStart = '', locEnd = '',  
	iIndex = loc.length, 
	strLang;
	lswww.locEnd = '';
	for(var i=1; i<=iSubSteps; i++)
	{
		for(var j=loc.length; j>=0; j--)
		{
			if(loc.charAt(j)=='/')
			{
				iIndex = j;
				break;
			}
		}
		lswww.locEnd = loc.substring(iIndex, loc.length) + lswww.locEnd;
		loc = loc.substring(0, iIndex);
	}
	lswww.locStart = loc.substring(0, iIndex-2);
	strLang  = loc.substring(iIndex-2, iIndex);
	lswww.strLangID = strLang;
	lisnav.graphicsDir = lswww.strPrefix+'_style/graphics/';
},


initNews : function (strID, strFrameID) 
{
	var el = document.getElementById(strID);
	new lswww.newsViewer(el, this.strLangID, strFrameID);
},

initNewsArchive : function (year) 
{
	this.init(2);
	this.createHeader();
	new lswww.NewsArchiveNavigator(year);	
},

initProduct : function (strProduct) 
{
	this.init(3);
	this.createHeader();
	this.createProductNavigationTable(strProduct);
},


initQuotation : function (strID, strFrameBoxID) 
{
	var el = document.getElementById(strID);
	var elB = document.getElementById(strFrameBoxID);
	new lswww.quotationViewer(el, elB, true);
},

setAttribs : function (el, attribs) 
{
	for (var x in attribs) 
	{
		el[x] = attribs[x];
	}
},

setStyles : function (el, styles) 
{
	for (var x in styles) 
	{
		if (lswww.ie && x == 'opacity') 
		{
			if (styles[x] > 0.99) 
			{
				el.style.removeAttribute('filter');
			} else 
			{
				el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')';
			}
		} else 
		{
			el.style[x] = styles[x];
		}
	}
}};

//-----------------------------------------------------------------------------
// Special frame class

lswww.Outline =  function (component, outlineType, onLoad) 
{
	this.component = component;
	this.outlineType = outlineType;

	this.table = lswww.createElement(
		'table', { cellSpacing: 0 },
		{
			visibility: 'hidden',
			position: 'absolute',
			borderCollapse: 'collapse',
			zIndex : '-10'
		},
		document.body,true);

	var tbody = lswww.createElement('tbody', null, null, this.table, true);
	
	this.td = [];
	for (var i = 0; i <= 8; i++) 
	{
		if (i % 3 === 0) 
		{
			tr = lswww.createElement('tr', null, { height: 'auto' }, tbody, true);
		}
		this.td[i] = lswww.createElement('td', null, null, tr, true);
		var style = (i!=4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' });
		lswww.setStyles(this.td[i], style);
	}
	this.td[4].className = outlineType;
	
	this.preloadGraphic();
};

lswww.Outline.prototype = {
preloadGraphic : function () {
	var src = lswww.strPrefix + '_style/graphics/frames/'+ this.outlineType +".png";
				
	var appendTo = lswww.safari ? lswww.container : null;
	this.graphic = lswww.createElement('img', null, { position: 'absolute', left: '-9999px', 
		top: '-9999px' }, appendTo, true); // for onload trigger
	
	var pThis = this;
	this.graphic.onload = function() { pThis.onGraphicLoad(); };
	this.graphic.src = src;
},

onGraphicLoad : function () {
	var o = this.offset = this.graphic.width/4,
		pos = [[0,0],[0,-4],[-2,0],[0,-9],0,[-2,-9],[0,-2],[0,-6],[-2,-2]],
		dim = { height: (2*o) +'px', width: (2*o) +'px' };
	lswww.discardElement(this.graphic);
	for (var i = 0; i <= 8; i++) 
	{
		if (pos[i]) 
		{
			lswww.setStyles(this.td[i], 
			{ 
				background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'
			});
		} else if(lswww.frameMiddleBG.length>0)
		{
			lswww.setStyles(this.td[i], 
			{ 
				background: 'url('+ lswww.frameMiddleBG +') 0px 0px repeat-x'
			});		
		}
			
			if (window.opera && (i == 3 || i ==5))
			{
				lswww.createElement('div', null, dim, this.td[i], true);
			}
			lswww.setStyles (this.td[i], dim);
	}
	
	if(lswww.headLoaded)
	{
		this.setPosition();
	} else
	{
		var v = this;
		setTimeout(function()
		{
			v.checkLoaded();
		}, 20);
	}
	if (this.onLoad) this.onLoad();
},

checkLoaded : function()
{
	var fLoaded = lswww.headLoaded;

	if(fLoaded)
	{
		this.setPosition();
	} else
	{
		var v = this;
		setTimeout(function()
		{
			v.checkLoaded();
		}, 3000);
	}
}, 

	
setPosition : function (exp, pos, vis) {

	var exp = 
	{
		x : { cb : this.component.width ? (this.component.width-(this.component.offsetWidth ? this.component.offsetWidth : 0))/2 : 0}, 
		y : { cb : this.component.height ? (this.component.height-(this.component.offsetHeight ? this.component.offsetHeight : 0))/2 : 0}
	};
	var p = lswww.getPosition(this.component);
	var pos = 
	{
		x: p.x, //(this.component.style.position=='absolute' ? 0 : p.x),
		y: p.y,
		w: this.component.offsetWidth + (this.component.scrollLeft ? this.component.scrollLeft : 0),
		h: this.component.offsetHeight
	};
	var img;
/*
if(!lswww.elDebug)
{
	lswww.elDebug = lswww.createElement('div', null, {position:'absolute',zIndex:'100',width:'10px',height:'10px',visibility:'hidden', background:'#ff0000'}, document.body);	
}	
lswww.setStyles(lswww.elDebug, {visibility:'visible',left:pos.x+'px',top:pos.y+'px',width:pos.w+'px'});
*/	
	pos = pos || {
		x: exp.x.min,
		y: exp.y.min,
		w: exp.x.span + exp.x.p1 + exp.x.p2,
		h: exp.y.span + exp.y.p1 + exp.y.p2
	};

	if (true) 
	{
		this.table.style.visibility = (pos.h >= 4 * this.offset) ? 'visible' : 'hidden';
	}
	lswww.setStyles(this.table, {
		left: (pos.x-this.offset) +'px',
		top: (pos.y-this.offset) +'px',
		width: (pos.w + 2 * (exp.x.cb + this.offset)) +'px'
	});

	pos.w += 2 * (exp.x.cb - this.offset);
	pos.h += + 2 * (exp.y.cb - this.offset);	

	lswww.setStyles (this.td[4], {
		width: pos.w >= 0 ? pos.w +'px' : 0,
		height: pos.h >= 0 ? pos.h +'px' : 0
	});
	if (this.hasAlphaImageLoader) 
	{
		this.td[3].style.height = this.td[5].style.height = this.td[4].style.height;
	}
},
	
destroy : function(hide) 
{
	if (hide) 
	{
		this.table.style.visibility = 'hidden';
	} else 
	{
		lswww.discardElement(this.table);
	}
}
};


//-----------------------------------------------------------------------------
// WWW header

lswww.Header = function()
{
	var elA, elTmp;
	var imgLogo, imgFlag;
	var table, tbody;
	var row;
	var cellLeft, cellMiddle, cellRight;
	
	var iChildren = document.body.childNodes.length;
	table = lswww.createElement('table', {cellSpacing : 0, border: '0px'}, {width: '100%'}, document.body, false, 'navTable');
	//Put table first in children
	for(var i=0; i<iChildren; i++)
	{
		elTmp = document.body.childNodes[0];
		document.body.removeChild(elTmp);
		document.body.appendChild(elTmp);
	}
	tbody = lswww.createElement('tbody', null, null, table, true);
	row = lswww.createElement('tr', null, null, tbody, false);
//	cellMiddle = lswww.createElement('td', null, {width: '100%'}, row, false);
	cellMiddle = lswww.createElement('td', {rowSpan : 3}, {verticalAlign: 'top'}, row, false);
	imgLogo = lswww.createElement('img', null, 
		{
			border : '0px'
		}, null, true);
	elA = lswww.createNavigationLink(cellMiddle, lswww.strPrefixLang+'index.html', imgLogo);	

	cellMiddle = lswww.createElement('td', {colSpan: 6}, {width: '100%', textAlign: 'right'}, row, false);
	imgFlag = lswww.createElement('img', null, {marginLeft: '4px'}, null, true);
	imgFlag.src = lswww.strPrefix+'images/flag_uk.gif';
	elA = lswww.createNavigationLink(cellMiddle, lswww.locStart + 'en'+lswww.locEnd, imgFlag);	
	imgFlag = lswww.createElement('img', null, {marginLeft: '4px'}, null, true);
	imgFlag.src = lswww.strPrefix+'images/flag_se.gif';
	elA = lswww.createNavigationLink(cellMiddle, lswww.locStart + 'se'+lswww.locEnd, imgFlag);	
	
	row = lswww.createElement('tr', null, {width: '100%', verticalAlign : 'middle'}, tbody, false, 'nav');
//	cellMiddle = lswww.createElement('td', {colSpan : 1}, {width: '16%', textAlign: 'center', verticalAlign : 'middle'}, row, false);
//	elA = lswww.createNavigationLink(cellMiddle, lswww.strPrefixLang+'index.html', lswww.getTextNode('navigationHome'), 'navigatoranchor');
//	cellMiddle.appendChild(document.createTextNode(lswww.strSP));
	cellMiddle = lswww.createElement('td', {colSpan : 1}, {width: '16%', textAlign: 'center', verticalAlign : 'middle'}, row, false);
	elA = lswww.createNavigationLink(cellMiddle, lswww.strPrefixLang+'about.html', lswww.getTextNode('navigationAbout'), 'navigatoranchor');
//	cellMiddle.appendChild(document.createTextNode(lswww.strSP));
	cellMiddle = lswww.createElement('td', {colSpan : 1}, {width: '16%', textAlign: 'center', verticalAlign : 'middle'}, row, false);
	elA = lswww.createNavigationLink(cellMiddle, lswww.strPrefixLang+'services.html', lswww.getTextNode('navigationServices'), 'navigatoranchor');	
//	cellMiddle.appendChild(document.createTextNode(lswww.strSP));
	cellMiddle = lswww.createElement('td', {colSpan : 1}, {width: '16%', textAlign: 'center', verticalAlign : 'middle'}, row, false);
	new lswww.ProcuctAnchor(cellMiddle, lswww.lang[lswww.strLangID]['navigationProducts']);
//	cellMiddle.appendChild(document.createTextNode(lswww.strSP));
	cellMiddle = lswww.createElement('td', {colSpan : 1}, {width: '16%', textAlign: 'center', verticalAlign : 'middle'}, row, false);
	new lswww.ResellerAnchor(cellMiddle, lswww.lang[lswww.strLangID]['navigationResellers']);
//	cellMiddle.appendChild(document.createTextNode(lswww.strSP));
	cellMiddle = lswww.createElement('td', {colSpan : 1}, {width: '16%', textAlign: 'center', verticalAlign : 'middle'}, row, false);
	elA = lswww.createNavigationLink(cellMiddle, lswww.strPrefixLang+'news/news.html', lswww.getTextNode('navigationNews'), 'navigatoranchor');	
//	cellMiddle.appendChild(document.createTextNode(lswww.strSP+lswww.strSP+lswww.strSP));

	row = lswww.createElement('tr', null, null, tbody, false);
	cellMiddle = lswww.createElement('td', {colSpan : 6}, {width: '100%'}, row, false);
	cellMiddle.appendChild(document.createTextNode(lswww.strSP));

//	row = lswww.createElement('tr', null, {horizontalAlign: 'right'}, tbody, false);
	//Left cell
//	cellLeft = lswww.createElement('td', null, null, row, false, 'navleft');
//	cellLeft.appendChild(document.createTextNode(lswww.strSP));
	//Middle cell
	//Right  cell
//	var cellRight = lswww.createElement('td', null, null, row, false, 'navright');
//	cellRight.appendChild(document.createTextNode(lswww.strSP));

	imgLogo.onload = function()
	{
		lswww.headLoaded = true;
	};
	imgLogo.src = lswww.strPrefix+'images/laidback-mirror.png';

};




//-----------------------------------------------------------------------------
// News archive navigator

lswww.NewsArchiveNavigator = function(iYear)
{
	var elLink, elA, elTmp;
	var img;
	var table, tbody;
	var row;
	var cellLink;
	var divProductTable;
	var currentDate = new Date();
	var elParent = document.getElementById('newsNavigation');
	
	if(!elParent) return;
	divTable = lswww.createElement('div', null, 
		{
			marginBottom : '30px'
//			display : 'inline-block'
		}, elParent, false);
	divTable.name = 'newsArchiveNavigation';
	divTable.id = 'box';
	
	elTmp = lswww.createElement('span', null, {}, divTable, false, 'boxTitle');
	elTmp.appendChild(document.createTextNode(lswww.getText('newsArchive')+ ' - ' + lswww.getText('menu')));

	table = lswww.createElement('table', {cellSpacing : '7px'}, {}, divTable, false);
	tbody = lswww.createElement('tbody', null, null, table, true);
	for(var iY=currentDate.getFullYear(); iY>=2006; iY--)
	{
		row = lswww.createElement('tr', null, null, tbody, false);
		cellLink = lswww.createElement('td', null, {verticalAlign : 'middle'}, row, false);
		if((iYear && iYear==iY) || (!iYear && iY==currentDate.getFullYear()))
		{
			cellLink.appendChild(document.createTextNode(iY));
		} else
		{
			elA = lswww.createNavigationLink(cellLink, 'news'+(iY==currentDate.getFullYear() ? '' : iY)+'.html', null);//, 'navigatoranchor');
			elA.appendChild(document.createTextNode(iY));
		}
	}

	//lswww.createFrame(divTable, lswww.frameID);
	
	this.createQuotation(elParent);	
};


lswww.NewsArchiveNavigator.prototype =
{

createQuotation : function(elParent)
{
	var divTable = lswww.createElement('div', null, 
		{
			marginTop : '30px',
			display : 'block'
		}, elParent, false, 'quotationBox');
	var elTmp;
	
	divTable.id='box';
	divTable.name = 'Quotation';
	elTmp = lswww.createElement('span', null, {}, divTable, false, 'boxTitle');
	elTmp.appendChild(lswww.getTextNode('customerQuotes'));

	new lswww.quotationViewer(divTable, divTable);
}

};



//-----------------------------------------------------------------------------
// Product navigator

lswww.ProductNavigator = function(strProduct)
{
	var elLink, elA, elTmp;
	var img;
	var table, tbody;
	var row;
	var cellLink;
	var divProductTable;
	var elParent = document.getElementById('productNavigation');
	
	if(!elParent) return;
	divProductTable = lswww.createElement('div', null, 
		{
			marginBottom : '30px'
//			display : 'inline-block'
		}, elParent, false);
	divProductTable.id = 'box';
	divProductTable.name = 'productionNavigation';
	
	elTmp = lswww.createElement('span', null, {}, divProductTable, false, 'boxTitle');
	elTmp.appendChild(document.createTextNode(strProduct + ' - ' + lswww.getText('menu')));

	table = lswww.createElement('table', {cellSpacing : '7px'}, {}, divProductTable, false);
	tbody = lswww.createElement('tbody', null, null, table, true);
	//Features
	row = lswww.createElement('tr', null, null, tbody, false);
	cellLink = lswww.createElement('td', null, {verticalAlign : 'middle'}, row, false);
	elA = lswww.createNavigationLink(cellLink, 'index.html', null);//, 'navigatoranchor');
	img = lswww.createElement('img', null, {verticalAlign : 'middle'}, elA, true);	
	img.src = lswww.strPrefix+'images/icons/features.png';
	elA.appendChild(document.createTextNode(lswww.strSP+lswww.strSP+lswww.strSP));
	elA.appendChild(lswww.getTextNode('features'));
	//More information
	row = lswww.createElement('tr', null, null, tbody, false);
	cellLink = lswww.createElement('td', null, {verticalAlign : 'middle'}, row, false);
	elA = lswww.createNavigationLink(cellLink, 'moreinfo.html', null);
	img = lswww.createElement('img', null, {verticalAlign : 'middle'}, elA, true);	
	img.src = lswww.strPrefix+'images/icons/moreinfo.png';
	elA.appendChild(document.createTextNode(lswww.strSP+lswww.strSP+lswww.strSP));
	elA.appendChild(lswww.getTextNode('moreInformation'));
	//Documents
	row = lswww.createElement('tr', null, null, tbody, false);
	cellLink = lswww.createElement('td', null, {verticalAlign : 'middle'}, row, false);
	elA = lswww.createNavigationLink(cellLink, 'documents.html', null);
	img = lswww.createElement('img', null, {verticalAlign : 'middle'}, elA, true);	
	img.src = lswww.strPrefix+'images/icons/documents.png';
	elA.appendChild(document.createTextNode(lswww.strSP+lswww.strSP+lswww.strSP));
	elA.appendChild(lswww.getTextNode('documents'));
	//Download
	row = lswww.createElement('tr', null, null, tbody, false);
	cellLink = lswww.createElement('td', null, {verticalAlign : 'middle'}, row, false);
	elA = lswww.createNavigationLink(cellLink, 'download.html', null);
	img = lswww.createElement('img', null, {verticalAlign : 'middle'}, elA, true);	
	img.src = lswww.strPrefix+'images/icons/download.png';
	elA.appendChild(document.createTextNode(lswww.strSP+lswww.strSP+lswww.strSP));
	elA.appendChild(lswww.getTextNode('download'));
	//Customers
	row = lswww.createElement('tr', null, null, tbody, false);
	cellLink = lswww.createElement('td', null, {verticalAlign : 'middle'}, row, false);
	elA = lswww.createNavigationLink(cellLink, 'customers.html', null);
	img = lswww.createElement('img', null, {verticalAlign : 'middle'}, elA, true);	
	img.src = lswww.strPrefix+'images/icons/customers.png';
	elA.appendChild(document.createTextNode(lswww.strSP+lswww.strSP+lswww.strSP));
	elA.appendChild(lswww.getTextNode('customers'));
	//Version history
	row = lswww.createElement('tr', null, null, tbody, false);
	cellLink = lswww.createElement('td', null, {verticalAlign : 'middle'}, row, false);
	elA = lswww.createNavigationLink(cellLink, 'versionhistory.html', null);
	img = lswww.createElement('img', null, {verticalAlign : 'middle'}, elA, true);	
	img.src = lswww.strPrefix+'images/icons/versionhistory.png';
	elA.appendChild(document.createTextNode(lswww.strSP+lswww.strSP+lswww.strSP));
	elA.appendChild(lswww.getTextNode('versionHistory'));
	//FAQ
	row = lswww.createElement('tr', null, null, tbody, false);
	cellLink = lswww.createElement('td', null, {verticalAlign : 'middle'}, row, false);
	elA = lswww.createNavigationLink(cellLink, 'faq.html', null);
	img = lswww.createElement('img', null, {verticalAlign : 'middle'}, elA, true);	
	img.src = lswww.strPrefix+'images/icons/faq.png';
	elA.appendChild(document.createTextNode(lswww.strSP+lswww.strSP+lswww.strSP));
	elA.appendChild(lswww.getTextNode('faq'));

	//lswww.createFrame(divProductTable, lswww.frameID);
	
	this.createQuotation();	
};


lswww.ProductNavigator.prototype =
{

createQuotation : function()
{
	var elParent = document.getElementById('productNavigation');
	var table = lswww.createElement('table', {width: '100%', padding: '0px', cellSpacing : '0px', cellPadding: '0px', marginTop: '30px', marginLeft: '0px', marginRight: '0px'}, {}, elParent, false, 'quotationBox');
	var tbody = lswww.createElement('tbody', null, null, table, true);
	//Features
	var row = lswww.createElement('tr', null, null, tbody, false);
	var cellQ = lswww.createElement('td', null, {verticalAlign : 'top'}, row, false);
	var elTmp;

	table.id = 'box';
	table.name = 'Quotation';

/*var divTable = lswww.createElement('div', null, 
		{
			marginTop : '30px'
//			, display : 'block' 
		}, elParent, false, 'quotationBox');
	
	divTable.id = 'box';
	divTable.name = 'Quotation';
	divTable.style.width = '180';
*/
	elTmp = lswww.createElement('span', null, {}, cellQ, false, 'boxTitle');
	elTmp.appendChild(lswww.getTextNode('customerQuotes'));

	new lswww.quotationViewer(cellQ, table);
}

};


//-----------------------------------------------------------------------------
//Special product anchor object
lswww.ProcuctAnchor = function(parent, strName)
{
	var itemMenuBar = lswww.createElement('ul', null, null, parent, false, 'MenuBarHorizontal');
	itemMenuBar.id = 'MenuProduct';
	var itemMenu = lswww.createElement('li', null, null, itemMenuBar, false);
	var elA = lswww.createElement('span', null, null, itemMenu, false, 'MenuBarItemSubmenu');
	//elA.href = "#";
	elA.appendChild(document.createTextNode(strName));
	

/*	
	var aProducts = lswww.createElement('a', null, null, parent, false, 'imageslide');
	aProducts.href = '#';
	aProducts.onclick = function()
	{
		return lisnav.expand(this, null, null, strName, 200);
	};
	aProducts.appendChild(document.createTextNode(strName));
	var divCaption = lswww.createElement('div', null, null, parent, false, 'imageslide-caption');
	var pCaption = lswww.createElement('p', null, null, divCaption, false);
*/
	this.createProductTable(itemMenu);
	new Spry.Widget.MenuBar("MenuProduct", {});
	return true;
};

lswww.ProcuctAnchor.prototype =
{

createProductTable : function(parent)
{
	var list = lswww.createElement('div', {}, {}, parent, true, 'subMenu');
	var iIndex = 0;

	this.createProductRow(list, null, lswww.strPrefixLang+'products/cargo/index.html', 'Cargo', ((iIndex++)%2===0), 'cargo');
	this.createProductRow(list, null, lswww.strPrefixLang+'products/colorman/index.html', 'ColorMan', ((iIndex++)%2===0), 'colorman');
	this.createProductRow(list, null, lswww.strPrefixLang+'products/convertme/index.html', 'ConvertMe', ((iIndex++)%2===0), 'convertme');
	this.createProductRow(list, null, lswww.strPrefixLang+'products/creole/index.html', 'Creole', ((iIndex++)%2===0),'creole');
	this.createProductRow(list, null, lswww.strPrefixLang+'products/feedback/index.html', 'Feedback', ((iIndex++)%2===0),'feedback');
	this.createProductRow(list, null, lswww.strPrefixLang+'products/filetrain/index.html', 'FileTrain', ((iIndex++)%2===0), 'filetrain');
	this.createProductRow(list, null, lswww.strPrefixLang+'products/proscript/index.html', 'PROscript', ((iIndex++)%2===0), 'proscript');
	this.createProductRow(list, null, lswww.strPrefixLang+'products/statwatch/index.html', 'StatWatch', ((iIndex++)%2===0), 'statwatch');
},

createProductRow : function(list, strImg, strA, strName, newRow, strNameShort)
{
	var listItem;
	var cellImg, cellA, cellDesc;
	var elA;
	var strDescription;
	var bg = (newRow ? '#fbfbfb' : 'white');

	listItem = lswww.createElement('p', null, {}, list, false, 'subMenuItem');
	elA = lswww.createElement('a', null, null, listItem, false);
	elA.href = strA;
	elA.appendChild(document.createTextNode(unescape(strName)));	
	
}
};



//-----------------------------------------------------------------------------
//Special reseller anchor object
lswww.ResellerAnchor = function(parent, strName)
{

	var itemMenuBar = lswww.createElement('ul', null, null, parent, false, 'MenuBarHorizontal');
	itemMenuBar.id = 'MenuReseller';
	var itemMenu = lswww.createElement('li', null, null, itemMenuBar, false);
	var elA = lswww.createElement('a', null, null, itemMenu, false, 'MenuBarItemSubmenu');
	elA.href = lswww.strPrefixLang+'resellers.html';
	elA.appendChild(document.createTextNode(strName));
	this.createResellerTable(itemMenu);
	new Spry.Widget.MenuBar("MenuReseller", {});

	return true;
/*	
var a = lswww.createElement('a', null, null, parent, false, 'imageslide');
	var divCaption = lswww.createElement('div', null, null, parent, false, 'imageslide-caption');
	var pCaption = lswww.createElement('p', null, null, divCaption, false);
	this.createResellerTable(pCaption);

	a.href = '#';
	a.rc = this;
	a.onclick = function()
	{
		return lisnav.expand(this, null, null, strName, this.rc.preferredWidth || 430);
	};
	a.appendChild(document.createTextNode(strName));

return true;
*/
};

lswww.ResellerAnchor.prototype =
{

createResellerTable : function(parent)
{
	var list = lswww.createElement('div', {}, {}, parent, true, 'subMenu');

	this.createResellerRow(list, 'aus', lswww.getText('australia'));
	this.createResellerRow(list, 'au', lswww.getText('austria'));
	this.createResellerRow(list, 'br', lswww.getText('brazil'));
	this.createResellerRow(list, 'ca', lswww.getText('canada'));
	this.createResellerRow(list, 'dk', lswww.getText('denmark'));
	this.createResellerRow(list, 'fi', lswww.getText('finland'));
	this.createResellerRow(list, 'fr', lswww.getText('france'));
	this.createResellerRow(list, 'de', lswww.getText('germany'));
	this.createResellerRow(list, 'ir', lswww.getText('ireland'));
	this.createResellerRow(list, 'israel', lswww.getText('israel'));
	this.createResellerRow(list, 'ita', lswww.getText('italy'));
	this.createResellerRow(list, 'nl', lswww.getText('netherland'));
	this.createResellerRow(list, 'no', lswww.getText('norway'));
	this.createResellerRow(list, 'sa', lswww.getText('southAfrica'));
	this.createResellerRow(list, 'es', lswww.getText('spain'));
	this.createResellerRow(list, 'se', lswww.getText('sweden'));
	this.createResellerRow(list, 'thai', lswww.getText('thailand'));
	this.createResellerRow(list, 'uk', lswww.getText('uk'));
}, 

createResellerRow : function(list, strA, strName)
{
	var listItem;
	var elA;
	
	listItem = lswww.createElement('p', null, {}, list, false, 'subMenuItem');
	elA = lswww.createElement('a', null, null, listItem, false);
	elA.href = lswww.strPrefixLang+'resellers.html#'+strA;
	elA.appendChild(document.createTextNode(unescape(strName)));	
	
}

/*
createResellerMap : function(map)
{
	this.createResellerMapArea(map, lswww.getText('australia'), 'rect', '312,135,354,171', 'aus');
	this.createResellerMapArea(map, lswww.getText('austria'), 'rect', '201,55,207,59', 'au');
	this.createResellerMapArea(map, lswww.getText('brazil'), 'poly', '134,158,117,128,107,126,120,111,131,112,149,125,145,143', 'br');
	this.createResellerMapArea(map, lswww.getText('canada'), 'rect', '70,31,141,54', 'ca');
	this.createResellerMapArea(map, lswww.getText('denmark'), 'rect', '195,47,202,51', 'dk');
	this.createResellerMapArea(map, lswww.getText('finland'), 'rect', '212,30,218,44', 'fi');
	this.createResellerMapArea(map, lswww.getText('france'), 'rect', '186,54,195,60', 'fr');
	this.createResellerMapArea(map, lswww.getText('germany'), 'rect', '195,50,203,56', 'de');
	this.createResellerMapArea(map, lswww.getText('ireland'), 'poly', '184,52,181,47,179,52', 'ir');
	this.createResellerMapArea(map, lswww.getText('israel'), 'circle', '226,77,2', 'israel');
	this.createResellerMapArea(map, lswww.getText('italy'), 'poly', '199,61,204,67,206,69,207,64,203,60', 'ita');
	this.createResellerMapArea(map, lswww.getText('netherland'), 'rect', '191,53,193,56', 'nl');
	this.createResellerMapArea(map, lswww.getText('norway'), 'poly', '209,29,202,38,200,44,194,38,205,27', 'no');
	this.createResellerMapArea(map, lswww.getText('southAfrica'), 'rect', '204,149,226,160', 'sa');
	this.createResellerMapArea(map, lswww.getText('spain'), 'rect', '181,60,194,71', 'es');
	this.createResellerMapArea(map, lswww.getText('sweden'), 'poly', '209,32,200,44,207,47', 'se');
	this.createResellerMapArea(map, lswww.getText('thailand'), 'rect', '293,91,312,121', 'thai');
	this.createResellerMapArea(map, lswww.getText('uk'), 'poly', '184,42,188,53,192,50,188,44', 'uk');
}, 

createResellerMapArea : function(map, strTitle, strShape, strCoord, strA)
{
	var area = lswww.createElement('area', null, {}, map, false);
	area.shape = strShape;
	area.coords = strCoord;
	area.title = strTitle;
	area.href = lswww.strPrefixLang+'resellers.html#'+strA;
	
	var link = lswww.createNavigationLink(map.parentNode, lswww.strPrefixLang+'resellers.html#'+strA, document.createTextNode(strTitle));
	lswww.createElement('br', null, {}, map.parentNode, false);
}
*/
};

/**
 * Quotation randomized viewer
 *
 * rgQuotes	
 *	Array with div objects containing the quotes and by lines
 */
lswww.quotationViewer = function(parent, frameBox, showTitle)
{
	var iCount;

	this.parent = parent;
	this.parentFrame = frameBox;
	this.shownQuotes = [];
	this.duration = lswww.quotationDuration;
	this.name = 'Quotation Viewer';

	this.initializeQuotes(lswww.strLangID, showTitle);
	iCount = this.getNumberOfQuotes();
	if(iCount>0) 
	{
		this.showQuote();
	}
};

lswww.quotationViewer.prototype = 
{


getCurrentQuote : function()
{
	return this.rgQuotes[this.quoteIndexShown];
}, 

getNumberOfQuotes : function()
{
	return this.rgQuotes.length;
}, 

hideQuote : function(cnt)
{
	var qv = this,
	t,
	elPos,
	elBounds,
	yStart,
	yEnd,
	easing;

	elPos = lswww.getPosition(this.parent);
	elBounds = {
		x : elPos.x, 
		y : elPos.y+30, 
		w : this.parent.offsetWidth || this.parent.width, 
		h : this.parent.offsetHeight-30 || this.parent.height-30
	};
	yStart = 0;
	yEnd = elBounds.h;
	easing = Math.easeOutElastic;//Math.easeInOutQuad;
	for(var i=1; i<=lswww.quotationOutSteps; i++) 
	{
		t = Math.round(i * (lswww.quotationOutDuration / lswww.quotationOutSteps));
		(function()
		{
			var pI=i, pos = {}, qv2=qv, cnt2=cnt;
			
			pos.left = elBounds.x;
			pos.top = elBounds.y + yStart;//easing(t, yStart, yEnd-yStart, lswww.quotationInDuration, 2,1);
			pos.width = elBounds.w;
			pos.height = elBounds.h;
			pos.opacity = (lswww.quotationInSteps-i)/lswww.quotationInSteps;
			setTimeout ( function() 
			{
				qv.setQuoteStyles(cnt2, pos);
				if (pI == lswww.quotationOutSteps) 
				{
					qv2.parent.removeChild(cnt2);
					lswww.setStyles(cnt2, 
					{
						visibility : 'hidden',
						display: 'none'
					}); 
				}
			}, t);				
		})();
	}
	setTimeout(function() {
		qv.quoteHidden();
	}, t+50);

}, 

initializeQuotes : function(strLangID, showTitle)
{
	var rgQuotes = lswww.quotes[strLangID];
	var pTmp, elTmp;

	//lswww.createFrame(this.parentFrame, lswww.frameID);
	this.rgQuotes = [];
	for(var i=0; i<rgQuotes.length; i++)
	{
		this.rgQuotes[i] = lswww.createElement('div', null, 
			{
				visibility: 'hidden', 
				display: 'none', 
				MARGIN: '0px'
				//position : 'absolute', 
				//backgroundColor : 'white'
			}, null, true);
		this.rgQuotes[i].quote = 'true';

		if(showTitle)
		{
			elTmp = lswww.createElement('span', null, {}, this.rgQuotes[i], false, 'boxTitle');
			elTmp.appendChild(lswww.getTextNode('customerQuotes'));
		}
		pTmp = lswww.createElement('div', null, {marginTop: '15px'}, this.rgQuotes[i], true, 'quoteProduct');
//		lswww.setStyles(pTmp, {marginBottom : '14px'});

//		elTmp = lswww.createElement('span', null, {}, pTmp, false);
		/*elTmp.appendChild(lswww.getTextNode('customerQuotes'));
		pTmp.appendChild(document.createElement('br'));
		*/
		pTmp.appendChild(document.createTextNode(rgQuotes[i][2]));

		pTmp = lswww.createElement('img', null, 
			{
				marginRight : '0px',
				padding : '0px', 
//				position : 'absolute',
				left : '-7px', 
				top : '25px', 
				zIndex : '0'
			}, this.rgQuotes[i], true);
		lswww.setStyles(pTmp, {opacity : '0.25'});
		pTmp.src = lswww.strPrefix + '_style/graphics/quotes-1.png';

		pTmp = lswww.createElement('span', null, {padding:'12px', margin:'0px'}, this.rgQuotes[i], false);
		pTmp.className = 'quote';
		pTmp.appendChild(document.createTextNode(rgQuotes[i][0]));

		pTmp = lswww.createElement('img', null, 
			{
				marginLeft : '0px',
				marginTop : '0px', 
				verticalAlign : 'middle' 
			}, this.rgQuotes[i], true);
		lswww.setStyles(pTmp, {opacity : '0.25'});
		pTmp.src = lswww.strPrefix + '_style/graphics/quotes-2.png';

		pTmp = lswww.createElement('p', null, {}, this.rgQuotes[i], false);
		pTmp.className = 'quoteByline';
		pTmp.appendChild(document.createTextNode(rgQuotes[i][1]));
	}
}, 

quoteHidden : function()
{
	var qv = this;
	setTimeout(function() {
		qv.showQuote();
	}, 5);
}, 

quoteReady : function()
{
	var qv = this;

	setTimeout(function() {
		var hide = false;
		//Hide previous quote
		for(var i=0; i<qv.parent.childNodes.length; i++)
		{
			if(qv.parent.childNodes[i].quote)
			{
				hide = true;
				qv.hideQuote(qv.parent.childNodes[i]);
			}
		}
		
	}, this.duration);
}, 


setQuoteStyles : function(cnt, pos)
{
	lswww.setStyles(cnt, 
	{
		top : pos.top+'px', 
		left : pos.left+'px', 
		width : pos.width+'px', 
		height : pos.height+'px', 
		opacity : pos.opacity
	});
},

showQuote : function()
{
	var iIndex = Math.round(Math.random()*(this.getNumberOfQuotes()-1)), 
	qv = this,
	t,
	elPos,
	elBounds,
	yStart,
	yEnd,
	easing, fNew;
	
	if(this.shownQuotes.length==this.getNumberOfQuotes()) 
	{
		this.shownQuotes = [];
	}
	fNew = false;
	while(!fNew)
	{
		iIndex = Math.round(Math.random()*(this.getNumberOfQuotes()-1));
		fNew = true;
		for(var i=0; i<this.shownQuotes.length; i++)
		{
			if(this.shownQuotes[i]==iIndex)
			{
				fNew = false;
				break;
			}
		}
	}
	this.quoteIndexShown = iIndex;
	this.shownQuotes[this.shownQuotes.length] = iIndex;
	elPos = lswww.getPosition(this.parent);
	elBounds = {
		x : elPos.x, 
		y : elPos.y+30, 
		w : this.parent.offsetWidth || this.parent.width, 
		h : this.parent.offsetHeight-30 || this.parent.height-30 
	};
	easing = Math.easeOutElastic;//Math.easeInOutQuad;
	for(var i=1; i<=lswww.quotationInSteps; i++) 
	{
		t = Math.round(i * (lswww.quotationInDuration / lswww.quotationInSteps));
		(function()
		{
			var pI=i, pos = {}, qv2=qv;
			
			pos.left = elBounds.x;
			pos.top = elBounds.y;//easing(t, yStart, yEnd-yStart, lswww.quotationInDuration, 2,1);
			pos.width = elBounds.w;
			pos.height = elBounds.h;//yStart-pos.y;
			pos.opacity = (i)/lswww.quotationInSteps;
			setTimeout ( function() 
			{
				if (pI == 1) 
				{
					lswww.setStyles(qv2.getCurrentQuote(), 
					{
						visibility : 'visible',
						display: 'block'
					}); 
					qv2.parent.appendChild(qv2.getCurrentQuote());
				}
				qv.setQuoteStyles(qv2.getCurrentQuote(), pos);
			}, t);				
		})();
	}
	setTimeout(function() {
		qv.quoteReady();
	}, t+50);
}
	
};


/**
 * News viewer
 *
 * rgNews	
 *	Array with div objects containing the news
 */
lswww.newsViewer = function(parent, strLangID, strFrameID)
{
	var iCount;

	this.rgNews = [];
	this.parent = parent;
	this.frameID = strFrameID;
	this.name = 'News Viewer';
	lswww.newsViewer = this;
	lswww.newsLoaded = false;
	this.initializeNews(strLangID);	
};

lswww.newsViewer.prototype = 
{
loaded : false, 
location : '', 

getNewsCount : function()
{
	return this.rgNews.length;
}, 

initializeNews : function(strLangID)
{
	var newsURL = 'news/news.html';
	var newsURLCheck = lswww.locStart+lswww.strLangID+'/news/news.html';
	var topWindow = window;
	while(topWindow.parent && topWindow.parent!=topWindow)
	{
		topWindow = topWindow.parent;
	}
	lswww.newsViewer.loaded = false;
	lswww.newsViewer.newsURLHolder = topWindow.frames['hiddenNewsFrame'];
//alert('1: '+lswww.newsViewer.newsURLHolder);
	lswww.newsViewer.newsURLHolder.location.href = "about:blank";
//	lswww.newsViewer.newsURLHolder.location = "#";
	lswww.newsViewer.newsURLHolder.onload = lswww.newsViewer.urlLoaded;
	if(lswww.newsViewer.newsURLHolder.location.href && lswww.newsViewer.newsURLHolder.location.href==newsURLCheck)
	{
		lswww.newsViewer.urlLoaded();
	} else
	{
//		lswww.newsViewer.location = newsURLCheck;
		lswww.newsViewer.newsURLHolder.location.href = newsURLCheck;
	}
//	if(lswww.safari || lswww.ie) 
	{
		var v = lswww.newsViewer;
		setTimeout(function()
		{
			v.checkURLLoaded();
		}, 400);
	}
}, 

checkURLLoaded : function()
{
	var w = lswww.newsViewer.newsURLHolder;
	var d = w ? w.document : null;
	var iL = d ? d.getElementsByTagName('H3').length : 0;
	if(iL>=lswww.firstPageNewsCount)
	{
		var v = lswww.newsViewer;
		setTimeout(function()
		{
			v.urlLoaded();
		}, 20);
	} else
	{
		var v = lswww.newsViewer;
		setTimeout(function()
		{
			if(!lswww.newsViewer.loaded)
			{
				v.checkURLLoaded();
			}
		}, 300);
	}
	return true;
}, 

urlLoaded : function()
{
	if(lswww.newsViewer.loaded) return;
	lswww.newsViewer.loaded = true;

	var newsDoc = lswww.newsViewer.newsURLHolder.window.document;
	var aTags = newsDoc.anchors;
	var h3Tags = newsDoc.getElementsByTagName('H3');
	var elH, elA, elDate;
	var elNewsA, elNewsTmp;
	var aIndex = 0;
	var strLink;

	//Remove old news
	for(var iC=0; iC<lswww.newsViewer.parent.childNodes.length; iC++)
	{
		if(lswww.newsViewer.parent.childNodes[iC].className == 'news')
		{
			lswww.newsViewer.parent.removeChild(lswww.newsViewer.parent.childNodes[iC]);
			iC--;
		}
	}

	for(var i=0; i<Math.min(lswww.firstPageNewsCount, h3Tags.length); i++)
	{
		elH = h3Tags[i];//.cloneNode(true);
		elA = null;
		for(var iA=aIndex; iA<aTags.length; iA++)
		{
			if(aTags[iA].id=='newsAnchor')
			{
				elA = aTags[iA];
				aIndex = iA+1;
				break;
			}
		}
		
		//Workaround for cloning in IE
		elH = elH.childNodes[0];
		strLink = elH.nodeValue;
		
		//Create news row
		elNewsTmp = lswww.createElement('p', null, {}, lswww.newsViewer.parent, false, 'news');
		elDate = lswww.createElement('p', null, {}, elNewsTmp, false, 'date');
		elDate.appendChild(document.createTextNode(elA ? elA.getAttribute('name') : ''));
		//Create anchor element
		elNewsA = lswww.createElement(elA ? 'a' : 'span', null, null, elNewsTmp, false);
		elNewsA.href = elA ? lswww.strPrefixLang+'news/news.html#'+elA.getAttribute('name') : '#';
		elNewsA.appendChild(document.createTextNode(strLink));	
	}

	lswww.createFrame(lswww.newsViewer.parent, lswww.newsViewer.frameID);
}

};


var Spry;
if(!Spry)
{
	Spry = {};
}
if(!Spry.Widget)
{
	Spry.Widget = {};
}

// Constructor for Menu Bar
// element should be an ID of an unordered list (<ul> tag)
// preloadImage1 and preloadImage2 are images for the rollover state of a menu
Spry.Widget.MenuBar = function(element, opts)
{
	this.init(element, opts);
};

Spry.Widget.MenuBar.prototype.init = function(element, opts)
{
	this.element = this.getElement(element);

	// represents the current (sub)menu we are operating on
	this.currMenu = null;

	var isie = (typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE');

	if(typeof document.getElementById == 'undefined' || (navigator.vendor == 'Apple Computer, Inc.' && typeof window.XMLHttpRequest == 'undefined') || (isie && typeof document.uniqueID == 'undefined'))
	{
		// bail on older unsupported browsers
		return;
	}

	// load hover images now
	if(opts)
	{
		for(var k in opts)
		{
			var rollover = new Image;
			rollover.src = opts[k];
		}
	}

	if(this.element)
	{
		this.currMenu = this.element;
		var items = this.element.getElementsByTagName('li');
		for(var i=0; i<items.length; i++)
		{
			this.initialize(items[i], element, isie);
			if(isie)
			{
//				this.addClassName(items[i], "MenuBarItemIE");
				items[i].style.position = "static";
			}
		}
		if(isie)
		{
			if(this.hasClassName(this.element, "MenuBarVertical"))
			{
				this.element.style.position = "relative";
			}
			var linkitems = this.element.getElementsByTagName('a');
			for(var i=0; i<linkitems.length; i++)
			{
				linkitems[i].style.position = "relative";
			}
		}
	}

};

Spry.Widget.MenuBar.prototype.getElement = function(ele)
{
	if (ele && typeof ele == "string")
		return document.getElementById(ele);
	return ele;
};

Spry.Widget.MenuBar.prototype.hasClassName = function(ele, className)
{
	if (!ele || !className || !ele.className || ele.className.search(new RegExp("\\b" + className + "\\b")) == -1)
	{
		return false;
	}
	return true;
};

Spry.Widget.MenuBar.prototype.addClassName = function(ele, className)
{
	if (!ele || !className || this.hasClassName(ele, className))
		return;
	ele.className += (ele.className ? " " : "") + className;
};

Spry.Widget.MenuBar.prototype.removeClassName = function(ele, className)
{
	if (!ele || !className || !this.hasClassName(ele, className))
		return;
	ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
};

// addEventListener for Menu Bar
// attach an event to a tag without creating obtrusive HTML code
Spry.Widget.MenuBar.prototype.addEventListener = function(element, eventType, handler, capture)
{
	try
	{
		if (element.addEventListener)
		{
			element.addEventListener(eventType, handler, capture);
		}
		else if (element.attachEvent)
		{
			element.attachEvent('on' + eventType, handler);
		}
	}
	catch (e) {}
};

// createIframeLayer for Menu Bar
// creates an IFRAME underneath a menu so that it will show above form controls and ActiveX
Spry.Widget.MenuBar.prototype.createIframeLayer = function(menu)
{
	var layer = document.createElement('iframe');
	layer.tabIndex = '-1';
	layer.src = 'javascript:false;';
	menu.parentNode.appendChild(layer);
	
	layer.style.left = menu.offsetLeft + 'px';
	layer.style.top = menu.offsetTop + 'px';
	layer.style.width = menu.offsetWidth + 'px';
	layer.style.height = menu.offsetHeight + 'px';
};

// removeIframeLayer for Menu Bar
// removes an IFRAME underneath a menu to reveal any form controls and ActiveX
Spry.Widget.MenuBar.prototype.removeIframeLayer =  function(menu)
{
	var layers = menu.parentNode.getElementsByTagName('iframe');
	while(layers.length > 0)
	{
		layers[0].parentNode.removeChild(layers[0]);
	}
};

// clearMenus for Menu Bar
// root is the top level unordered list (<ul> tag)
Spry.Widget.MenuBar.prototype.clearMenus = function(root)
{
	var menus = root.getElementsByTagName('ul');
	for(var i=0; i<menus.length; i++)
	{
		this.hideSubmenu(menus[i]);
	}
	this.removeClassName(this.element, "MenuBarActive");
};

// bubbledTextEvent for Menu Bar
// identify bubbled up text events in Safari so we can ignore them
Spry.Widget.MenuBar.prototype.bubbledTextEvent = function()
{
	return (navigator.vendor == 'Apple Computer, Inc.' && (event.target == event.relatedTarget.parentNode || (event.eventPhase == 3 && event.target.parentNode == event.relatedTarget)));
};

// showSubmenu for Menu Bar
// set the proper CSS class on this menu to show it
Spry.Widget.MenuBar.prototype.showSubmenu = function(menu)
{
	if(this.currMenu)
	{
		this.clearMenus(this.currMenu);
		this.currMenu = null;
	}
	
	if(menu)
	{
		this.addClassName(menu, "MenuBarSubmenuVisible");
		if(typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE')
		{
			if(!this.hasClassName(this.element, "MenuBarHorizontal") || menu.parentNode.parentNode != this.element)
			{
				menu.style.top = menu.parentNode.offsetTop + 'px';
			}
		}
		if(typeof document.uniqueID != "undefined")
		{
//			this.createIframeLayer(menu);
		}
	}
	this.addClassName(this.element, "MenuBarActive");
};

// hideSubmenu for Menu Bar
// remove the proper CSS class on this menu to hide it
Spry.Widget.MenuBar.prototype.hideSubmenu = function(menu)
{
	if(menu)
	{
		this.removeClassName(menu, "MenuBarSubmenuVisible");
		if(typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE')
		{
			menu.style.top = '';
			menu.style.left = '';
		}
		this.removeIframeLayer(menu);
	}
};

// initialize for Menu Bar
// create event listeners for the Menu Bar widget so we can properly
// show and hide submenus
Spry.Widget.MenuBar.prototype.initialize = function(listitem, element, isie)
{
	var opentime, closetime;
	var link = listitem.getElementsByTagName('a')[0];
	var submenus = listitem.getElementsByTagName('div');
	var menu = (submenus.length > 0 ? submenus[0] : null);

	var hasSubMenu = false;
	if(menu)
	{
		this.addClassName(link, "MenuBarItemSubmenu");
		hasSubMenu = true;
	}

	if(!isie)
	{
		// define a simple function that comes standard in IE to determine
		// if a node is within another node
		listitem.contains = function(testNode)
		{
			// this refers to the list item
			if(testNode == null)
			{
				return false;
			}
			if(testNode == this)
			{
				return true;
			}
			else
			{
				return this.contains(testNode.parentNode);
			}
		};
	}
	
	// need to save this for scope further down
	var self = this;

	this.addEventListener(listitem, 'mouseover', function(e)
	{
		if(self.bubbledTextEvent())
		{
			// ignore bubbled text events
			return;
		}
		clearTimeout(closetime);
		if(self.currMenu == listitem)
		{
			self.currMenu = null;
		}
		// show menu highlighting
		self.addClassName(link, hasSubMenu ? "MenuBarItemSubmenuHover" : "MenuBarItemHover");
		if(menu && !self.hasClassName(menu, "MenuBarSubmenuVisible"))
		{
			opentime = window.setTimeout(function(){self.showSubmenu(menu);}, 50);
		}
	}, false);

	this.addEventListener(listitem, 'mouseout', function(e)
	{
		if(self.bubbledTextEvent())
		{
			// ignore bubbled text events
			return;
		}

		var related = (typeof e.relatedTarget != 'undefined' ? e.relatedTarget : e.toElement);
		if(!listitem.contains(related))
		{
			clearTimeout(opentime);
			self.currMenu = listitem;

			// remove menu highlighting
			self.removeClassName(link, hasSubMenu ? "MenuBarItemSubmenuHover" : "MenuBarItemHover");
			if(menu)
			{
				closetime = window.setTimeout(function(){self.hideSubmenu(menu);}, 100);
			}
		}
	}, false);
};
