/*--------------------------------------------------------------------
' File:		Utils.js
' Purpose:	Handle Utility client-side issues
' Updated:	061121
' Version:	050500
' Edited:	TNY
' Status:	Release
' Copyright © Centroid Software Ab Oy 2000-2005, Finland
'		      InPlace Solutions Ab Oy 2006-2009
'				All rights reserved. 
'--------------------------------------------------------------------*/

//-------------------------------------------------------------
// Function:	repChars
// Desc:		string seach and replace
// Status:		Used only for temporarily menu fix menu problems and to solve ,. problems
function repChars(out,add,temp) 
{
	temp = "" + temp; 
	while (temp.indexOf(out)>-1) {
		var pls= temp.indexOf(out);
		temp = "" + (temp.substring(0, pls) + add + 
	temp.substring((pls + out.length), temp.length));
	}
	return temp;
}

//-------------------------------------------------------------
// Function:	SWAction
// Desc:		NULL function
// Status:		0600
function SWAction() {
}

//--------------------------------------------------------------------
//  Function:	readCookie
//  Purpose:	reads the cookie
//  Status		0505
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length)
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

//-------------------------------------------------------------
// Function:	printHtml
// Desc:		writeln workaround for 'IE click to activate' issue
// Status:		0505
function printHtml(s) { 
	document.writeln(s); 
}