	var mainColor		= prepareColor(getStyle("maincolor").color);
	var mainAlternate	= prepareColor(getStyle("mainalternate").color);
	var mainHeading 	= prepareColor(getStyle("mainheading").color);
	var mainText		= prepareColor(getStyle("maintext").color);
	var mainLink		= prepareColor(getStyle("mainlink").color);
	
	var secondaryColor		= prepareColor(getStyle("secondarycolor").color);
	var secondaryAlternate	= prepareColor(getStyle("secondaryalternate").color);
	var secondaryHeading	= prepareColor(getStyle("secondaryheading").color);
	var secondaryText		= prepareColor(getStyle("secondarytext").color);
	var secondaryLink		= prepareColor(getStyle("secondarylink").color);

	getStyle("body").backgroundColor =	secondaryColor;
	getStyle("sbbox").backgroundImage = colorizeStyleImage("/so4/internal/site/t165/en/image/sb_box2.png", secondaryColor, "&output=gif&stage.color=" + secondaryColor);
	getStyle("bodytile").backgroundImage = colorizeStyleImage("/so4/internal/site/t165/en/image/body_tile.png", shadeColor(secondaryColor, 0.30), "&output=jpg&stage.color=" + secondaryColor);
	getStyle("footertile").backgroundImage = colorizeStyleImage("/so4/internal/site/t165/en/image/footer_tile1.png", shadeColor(secondaryColor, 0.30), "&output=jpg&stage.color=" + secondaryColor);	
	getStyle("topbar").backgroundImage = colorizeStyleImage("/so4/internal/site/t165/en/image/top_bar_tile.png", mainColor, "&output=jpg&");


	getStyle("table").backgroundColor = mainColor;
	getStyle("topline").backgroundColor = shadeColor(mainColor, 0.20);
	getStyle("bottomline").backgroundColor = secondaryAlternate;
	getStyle("border").borderColor = mainColor;
	getStyle("line").backgroundColor = mainColor;
	getStyle("navline").backgroundColor = shadeColor(secondaryColor, 0.20);
	getStyle("sale").backgroundColor = secondaryAlternate;
	getStyle("prodrow").backgroundColor = shadeColor(secondaryColor, 0.10);

	getStyle("subpagelist").backgroundColor = secondaryColor;
	getStyle("subpagelist").borderColor = mainColor;

	getStyle("text").color = secondaryText;
	getStyle("heading").color = mainHeading;
	getStyle("textmain").color = mainText;
	getStyle("saletext").color = secondaryColor;
	getStyle("textsale").color = secondaryAlternate;
	getStyle("textcolor").color = secondaryAlternate;
	getStyle("sechead").color = secondaryHeading;
	getStyle("mainhead").color = mainHeading;
	getStyle("borderlinkelements").borderColor = secondaryLink;

	getStyleBySelector("a:link").color = secondaryLink;
	getStyleBySelector("a:active").color = secondaryLink;
	getStyleBySelector("a:visited").color = secondaryLink;
	getStyleBySelector("a:hover").color = shadeColor(secondaryLink, 0.5);

	getStyleBySelector(".subpagelist a:link").color = secondaryLink;
	getStyleBySelector(".subpagelist a:active").color = secondaryLink;
	getStyleBySelector(".subpagelist a:visited").color = secondaryLink;
	getStyleBySelector(".subpagelist a:hover").color = shadeColor(secondaryLink, 0.5);

	getStyleBySelector(".linkelements a:link").color = secondaryLink;
	getStyleBySelector(".linkelements a:active").color = secondaryLink;
	getStyleBySelector(".linkelements a:visited").color = secondaryLink;
	getStyleBySelector(".linkelements a:hover").color = shadeColor(secondaryLink, 0.5);

	getStyleBySelector(".mainlinkelements a:link").color = mainLink;
	getStyleBySelector(".mainlinkelements a:active").color = mainLink;
	getStyleBySelector(".mainlinkelements a:visited").color = mainLink;
	getStyleBySelector(".mainlinkelements a:hover").color = shadeColor(mainLink, 0.5);


	
	function drawCurves(imagePath)
	{
		attributes =  "output=gif";
		attributes += "&stage.color=" + secondaryColor;
		attributes += "&cache=none";

		colorizeImage(imagePath, mainColor, "", attributes);
	}

	function drawPageName(inText, inExtra)
	{  
		attributes =  "background.fill.color=" + secondaryColor;
		attributes += "&label.text=" + inText;
		attributes += "&label.fill.color=" + secondaryHeading;
		attributes += "&arrow.fill.color=" + secondaryHeading;
		attributes += "&stage.color=" + secondaryColor;
	
		drawImage("/images/site/t165/en/image/pagename.img", attributes, inExtra);
	}

	function drawNumber(inText, inExtra, inBackground, inLabel)
	{  
		attributes =  "background.fill.color=" + inBackground;
		attributes += "&label.text=" + inText;
		attributes += "&label.fill.color=" + inLabel;
		attributes += "&stage.color=" + inBackground;
	
		drawImage("/images/site/t165/en/image/number.img", attributes, inExtra);
	}  
	
	function drawLabel(inText)
	{  
		attributes =  "background.fill.color=" + secondaryColor;
		attributes += "&label.text=" + inText;
		attributes += "&arrow.fill.color=" + secondaryHeading;
		attributes += "&label.fill.color=" + secondaryHeading;
		attributes += "&stage.color=" + secondaryColor;

		drawImage("/images/site/t165/en/image/label.img", attributes);
	}
	
	function drawSBLabel(inText)
	{  
		attributes =  "label.fill.color=" + secondaryHeading;
		attributes += "&label.text=" + inText;
		attributes += "&stage.color=" + secondaryColor;

		drawImage("/images/site/t165/en/image/sblabel.img", attributes);
	}	 

	function drawOptionButtons(inText, inExtra, inSpace)
	{
		attributes =  "rule.fill.color=" + shadeColor(mainAlternate, 0.65);
		attributes += "&label.text=" + inText;
		attributes += "&label.fill.color=" + secondaryText;
		attributes += "&background.image.colorize.color=" + mainColor;
		attributes += "&label.dropshadow.color=" + shadeColor(mainColor, 0.40);
		attributes += "&output=jpg";
		attributes += "&stage.color=" + secondaryColor;

		drawImage("/images/site/t165/en/image/optbuttons.img", attributes, inExtra);
	}

	function drawBigInputButtons(inText, inName, inExtra)
	{	
		attributes =  "stroke.fill.color=" + secondaryText;
		attributes += "&button.fill.color=" + secondaryColor;
		attributes += "&label.text=" + inText;
		attributes += "&label.fill.color=" + secondaryText;
		attributes += "&button.fill.gradient.start.color=" + shadeColor(secondaryColor, 0.15);
		attributes += "&button.fill.gradient.end.color=" + secondaryColor;
		attributes += "&button.dropshadow.color=" + secondaryText;		 
		attributes += "&stage.color=" + secondaryColor; 	  

		drawInputImage("/images/site/t165/en/image/bigbuttons.img", attributes, inName, inExtra);
	}

	function drawBigButtons(inText, inExtra, inExtraAttributes)
	{  
		attributes =  "stroke.fill.color=" + secondaryText;
		attributes += "&button.fill.color=" + secondaryColor;
		attributes += "&label.text=" + inText;
		attributes += "&label.fill.color=" + secondaryText;
		attributes += "&button.fill.gradient.start.color=" + shadeColor(secondaryColor, 0.15);
		attributes += "&button.fill.gradient.end.color=" + secondaryColor;
		attributes += "&button.dropshadow.color=" + secondaryText;		 
		attributes += "&stage.color=" + secondaryColor;
		attributes += "&label.opacity=" + inExtraAttributes;

		drawImage("/images/site/t165/en/image/bigbuttons.img", attributes, inExtra);
	}

	function drawSmallButtons(inText, inExtra, inExtraAttributes)
	{  
		attributes =  "stroke.fill.color=" + secondaryText;
		attributes += "&button.fill.color=" + secondaryColor;
		attributes += "&label.text=" + inText;
		attributes += "&label.fill.color=" + secondaryText;
		attributes += "&button.fill.gradient.start.color=" + shadeColor(secondaryColor, 0.15);
		attributes += "&button.fill.gradient.end.color=" + secondaryColor;
		attributes += "&button.dropshadow.color=" + secondaryText;		 
		attributes += "&stage.color=" + secondaryColor;
		attributes += "&label.opacity=" + inExtraAttributes;

		drawImage("/images/site/t165/en/image/smallbuttons.img", attributes, inExtra);
	}

	function drawSmallInputButtons(inText, inName, inExtra, inExtraAttributes)
	{
		attributes =  "stroke.fill.color=" + secondaryText;
		attributes += "&button.fill.color=" + secondaryColor;
		attributes += "&label.text=" + inText;
		attributes += "&label.fill.color=" + secondaryText;
		attributes += "&button.fill.gradient.start.color=" + shadeColor(secondaryColor, 0.15);
		attributes += "&button.fill.gradient.end.color=" + secondaryColor;
		attributes += "&button.dropshadow.color=" + secondaryText;		 
		attributes += "&stage.color=" + secondaryColor;
		attributes += "&label.opacity=" + inExtraAttributes;

		drawInputImage("/images/site/t165/en/image/smallbuttons.img", attributes, inName, inExtra);
	}

	function drawGoButtons(inName, inExtra)
	{
		attributes =  "arrow.fill.color=" + secondaryHeading;
		attributes += "&stage.color=" + secondaryColor;

		drawInputImage("/images/site/t165/en/image/gobuttons.img", attributes, inName, inExtra);
	}

	function drawNavButtons()
	{
		attributes = "&stage.color=" + secondaryColor;
		attributes += "&label.fill.color=" + secondaryHeading;
		attributes += "&label.fill.color.over=" + secondaryAlternate;
		attributes += "&label.fill.color.selected=" + mainColor;
		attributes += "&label.fill.color.selectedover=" + secondaryHeading;
		attributes += "&arrow.fill.color=" + secondaryHeading;
		attributes += "&arrow.fill.color.over=" + secondaryAlternate;
		attributes += "&arrow.fill.color.selected=" + mainColor;
		attributes += "&arrow.fill.color.selectedover=" + shadeColor(secondaryColor, 0.40);

		drawTabs("vertical", 0, 0, "VSPACE=2 BORDER=0", attributes, "/images/site/t165/en/image/btn.img");
	}
	
	function drawContentBorderBox (cellAlign)
	{
		attributes = "stage.color=" + secondaryColor;
		attributes += "&border.stroke.color=" +  shadeColor (secondaryColor, 0.15);
		attributes += "&border.fill.color=" + secondaryColor;
		attributes += "&border.dropshadow.color=" + shadeColor (mainColor, 0.75);

		drawBorderStart("535", attributes, "/images/site/t165/en/image/contentborder.img", cellAlign);
	}
	
	function drawLeftBarBorder (cellAlign)
	{
		attributes = "stage.color=" + secondaryColor;
		attributes += "&border.stroke.color=" +  shadeColor (secondaryColor, 0.15);
		attributes += "&border.fill.color=" + secondaryColor;
		attributes += "&border.dropshadow.color=" + shadeColor (mainColor, 0.75)

		drawBorderStart("179", attributes, "/images/site/t165/en/image/leftbarborder.img", cellAlign);
	}
	
// Date and Time	 
	function takeYear(theDate)
	{	// use getYear for compatibility and fix millenium bug
		x = theDate.getYear();
		var y = x % 100;
		y += (y < 38) ? 2000 : 1900;
		return y;
	}

	function leadingZero(nr)
	{	// add a leading zero to number if less than 10
		if (nr < 10) nr = "0" + nr;
		return nr;
	}

	function RKH_writeDateTime() // get date and time, assign to variables
	{
		var today = new Date();
		var myYearNum = takeYear(today);
		var myMonthNum = today.getMonth();
		var myDayNum = today.getDay();
		var myDateNum = today.getDate();
		var myHourNum = today.getHours();
		var myAmPm = "AM";
		var myMinNum = leadingZero(today.getMinutes());
		var mySecNum = leadingZero(today.getSeconds());
		// asign month numbers (0-11) to month names
		var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
		var myMonths = monthNames[myMonthNum];
		// asign day numbers (0-6) to day names
		var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
		var myDays = dayNames[myDayNum];
		// format and AM/PM, and 0-23hrs to 1-12
		if (myHourNum == 0) myHourNum = 12;
		if (myHourNum > 11) myAmPm = "PM";
		if (myHourNum > 12) myHourNum -= 12;
		// write date in this format
		// e.g. 12:00:00 am Tuesday, January 1, 2002 would be written as :
		// myHourNum + ":" + myMinNum + ":" + mySecNum + " " + myAmPm + " " + myDays + ", " + myMonths + " " + myDateNum + ", " + myYearNum
		return myDays + ", " + myMonths + " " + myDateNum + ", " + myYearNum;
	}
	
	function writeDateOutput() // write out date and time
	{
		document.write(RKH_writeDateTime());
	}			 
