//----------------------------------------------------------------------------------------------------------
// Browser testen, erzeugt stBrowser (gleich wie CF Browsererkennung)
// stBrowser.bMac 		-> true, false (boolean) 
// stBrowser.sVersion	-> Versionsnummer (float)
// stBrowser.sBrowser	-> "NS", "IE", "SAFARI", "OPERA" (string)
// stBrowser.sType		-> "DOM", "IELAYER", "NSLAYER" (string)


function oBrowser(f_bMac,f_sVersion,f_sBrowser,f_sType) 
{
	this.bMac = f_bMac;
	this.sVersion = f_sVersion;
	this.sBrowser = f_sBrowser;
	this.sType = f_sType;
}

var bMac = false;
var sVersion = 3.0;
var sBrowser = "IE";
var sType = "IELAYER";
var http_user_agent = navigator.userAgent.toLowerCase(); 	

if (http_user_agent.indexOf("mac") != -1)
{
	bMac = true;
}

if (http_user_agent.indexOf("opera") != -1) 
{
	sBrowser = "OPERA";
	if (http_user_agent.indexOf("opera 7") != -1 || http_user_agent.indexOf("opera/7") != -1)		sVersion = "7";
	else if (http_user_agent.indexOf("opera 6") != -1 || http_user_agent.indexOf("opera/6") != -1)	sVersion = "6";
	else if (http_user_agent.indexOf("opera 5") != -1 || http_user_agent.indexOf("opera/5") != -1)	sVersion = "5";
	else if (http_user_agent.indexOf("opera 4") != -1 || http_user_agent.indexOf("opera/4") != -1)	sVersion = "4";
	else if (http_user_agent.indexOf("opera 3") != -1 || http_user_agent.indexOf("opera/3") != -1)	sVersion = "3";
	else sVersion = "2";	
}	
else if (http_user_agent.indexOf("msie") != -1 && http_user_agent.indexOf("compatible") != -1)
{
	sBrowser = "IE";
	if (http_user_agent.indexOf("msie 5.5") != -1)			sVersion = "5.5";
	else if (http_user_agent.indexOf("msie 5.2") != -1)		sVersion = "5.2";
	else if (http_user_agent.indexOf("msie 5") != -1)		sVersion = "5";
	else if (http_user_agent.indexOf("msie 6") != -1)		sVersion = "6";
	else sVersion = "4";
}
else if (http_user_agent.indexOf("applewebkit") != -1 && http_user_agent.indexOf("safari") != -1)
{
	sBrowser = "SAFARI";
	sVersion = "1";
}	
else if (http_user_agent.indexOf("mozilla") != -1)
{
	sBrowser = "NS";
	if (http_user_agent.indexOf("mozilla/5") != -1)			sVersion = "5";
	else if (http_user_agent.indexOf("mozilla/4") != -1)	sVersion = "4";
	else if (http_user_agent.indexOf("mozilla/3") != -1)	sVersion = "3";
}	

if ((sBrowser == "IE" && sVersion >= 5 && !bMac) ||
	(sBrowser == "IE" && sVersion >= 5.2 && bMac) ||
	(sBrowser == "NS" && sVersion >= 5) || 
	(sBrowser == "OPERA" && sVersion >= 7) || 
	(sBrowser == "SAFARI" && sVersion >= 1))
{
	sType = "DOM";
}
else if (sBrowser == "NS" && sVersion == 4)
{
	sType = "NSLAYER";
}
else if ((sBrowser == "IE" && sVersion == 4) || (bMac && sBrowser == "IE" && sVersion <= 5))
{
	sType = "IELAYER";
}
else
{
	sType = "OLD";
}	

stBrowser = new oBrowser(bMac,sVersion,sBrowser,sType);

//--------------------------------------------------
/**
 * Application : CF WCMS CORE
 * File        : _js/dynmap.js
 * @version    : 0.1
 * @author     : acn <acn@getunik.com>
 * @copyright  : copyright 30.08.2006 by http://www.getunik.com
 * 
 * Long desc:
 * Function is used for divers clickactions by the dynmap map flash. 
 *
 * Version-History:
 * 30.08.2006.getunik.acn : initial release
 */


/**
 * dynamic function which enables different behaviours,
 * triggered by the dynmap flash map
 *
 * @param  intiger  onSwfClickAction.arguments[0]      "behaviour id": enables to differ different behaviours of the same function
 * @param  any      onSwfClickAction.arguments[1-n]    parameter list depending on the submitted bahaviour id
 *
 * example:
 * onSwfClickAction.arguments[0] = 1 = URL   (implemented)
 *   -> onSwfClickAction.arguments[1] = target url for the actual browser instance, a.e.: 'http://www.google.com'
 * onSwfClickAction.arguments[0] = 2 = AJAX  (not yet implemented)
 * onSwfClickAction.arguments[0] = 3 = FLASH (not yet implemented)
 */
function onSwfClickAction()
{
	bProc             = false;
	// iOrigActionTypeId = iActionTypeId;
	iOrigActionTypeId = onSwfClickAction.arguments[0];
	iActionTypeId     = iOrigActionTypeId - 1;
	sActionType       = "";
	
	// available action types
	aActionTypes    = new Array();
	aActionTypes[0] = "URL";
	aActionTypes[1] = "AJAX";
	aActionTypes[2] = "FLASH";
	
	// check iActionTypeId
	if(iActionTypeId >= 0 && iOrigActionTypeId <= aActionTypes.length)
	{
		bProc = true;
	}
	else
	{
		bProc = false;
		alert('dynmap.js\nError within onSwfClickAction():\nUnknown action type id (' + iOrigActionTypeId + ' / type: ' + typeof(iOrigActionTypeId) + ') submitted!');
	}
	
	// check parameter list (at least 2 params needed)
	if(bProc)
	{
		if(onSwfClickAction.arguments.length >= 2)
		{
			bProc = true;
		}
		else
		{
			bProc = false;
			alert('dynmap.js\nError within onSwfClickAction():\nAt least two (2) parameters required!');
		}
	}
	
	// get action type from aActionTypes
	if(bProc)
	{
		sActionType = aActionTypes[iActionTypeId];
		if(sActionType != "")
		{
			bProc = true;
		}
		else
		{
			bProc = false;
			alert('dynmap.js\nError within onSwfClickAction():\nThe action type id ' + iOrigActionTypeId + 'is ok, but the corresponding value within aActionTypes is not defined!');
		}
	}
	
	// processing depending on the sActionType
	if(bProc)
	{
		
		// *** URL
		if(sActionType == "URL")
		{
			sUrl = onSwfClickAction.arguments[1];
			if(sUrl != undefined && sUrl != '' && typeof(sUrl) == 'string')
			{
				top.window.location.href = sUrl;
			}
			else
			{
				alert('dynmap.js\nError within onSwfClickAction():\nThe submitted parameter anyParam1 ' + sUrl + 'is not ok!');
			}
		} // eof URL
		
		
		// *** AJAX
		if(sActionType == "AJAX")
		{
			alert('dynmap.js\nonSwfClickAction():\nCorresponding processing for \'AJAX\' is not yet defined!');
		} // eof AJAX
		
		
		// *** FLASH
		if(sActionType == "FLASH")
		{
			alert('dynmap.js\nonSwfClickAction():\nCorresponding processing for \'FLASH\' is not yet defined!');			
		} // eof FLASH
		
		
	}
	
} // eof function onSwfClickAction()

//--------------------------------------------------
function getObject(f_sObject)
{
	if (stBrowser.sType == "DOM")
	{
		return document.getElementById(f_sObject);
	}
	else
	{
		return eval("document.all." + f_sObject);
	}
}

function noCache()
{
	return "uNC=" + parseInt(Math.random()*10000000);

}

/* win_open(where,x,y)*/
function winOpen(f_sWhere)
{
	if (arguments.length > 1)
	{
		sWin = arguments[1];
	}
	else
	{
		sWin = "default";
	}
	
	if (arguments.length <= 2)
	{
		iX = 700;
		iY = 550;
	}
	else
	{
		iX = arguments[2];
		iY = arguments[3];
	}
	
	win = window.open(f_sWhere,sWin,"resizable=yes,status=0,scrollbars=1,width="+iX+",height="+iY);
	win.focus();
}

function winOpenUpload(pageURL, paneName, w, h, scroll, titlebar)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = "height="+h+",width="+w+",top="+wint+",left="+winl+",scrollbars="+scroll+",resizable";
	win = window.open(pageURL, paneName, winprops);
	if (parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
}


function getCheckedValue(f_objRadio)
{
	
	
	if(f_objRadio.length == undefined)
	{
		if (f_objRadio.checked == true) 
		{
			return f_objRadio.value
		}
	}
	else
	{
		for (i = 0; i < f_objRadio.length; i++) 
		{
			if (f_objRadio[i].checked == true) 
			{
				return f_objRadio[i].value
			}
		}	
	}
	return -1;
}


function showLayer(f_sObject)
{

	obj = getObject(f_sObject);
	if (obj.style.visibility == "hidden")
	{
		obj.style.visibility = "visible";
	}
	else
	{
		obj.style.visibility = "hidden";
	}
}

function initTime(f_iYear,f_iMonth,f_iDay,f_iHours,f_iMinutes,f_iSeconds)
{
	var objServerTime = new Date(f_iYear,f_iMonth-1,f_iDay,f_iHours,f_iMinutes,f_iSeconds);
	var objClientTime = new Date();
	var iTimeDiff = objClientTime - objServerTime;
	writeTime(iTimeDiff);
}

function writeTime(f_iTimeDiff)
{
	var objTime = new Date();
	objTime.setTime(objTime.getTime() - f_iTimeDiff);
	if (objTime.getHours() < 10) 
		sHours = "0" + objTime.getHours();
	else
		sHours = objTime.getHours();
		
	if (objTime.getMinutes() < 10) 
		sMinutes = "0" + objTime.getMinutes();
	else
		sMinutes = objTime.getMinutes();
		
	if (objTime.getSeconds() < 10) 
		sSeconds = "0" + objTime.getSeconds();
	else
		sSeconds = objTime.getSeconds();
			  
	getObject("lyTime").innerHTML = sHours + ":" + sMinutes + ":" + sSeconds;
	setTimeout("writeTime("+f_iTimeDiff+")",1000);
	
}


function trim(f_sString)
{
	var regW1 = /^\s+/;
	var regW2 = /\s+$/;
	sString = f_sString;
	
	sString = sString.replace(regW1,"");
	sString = sString.replace(regW2,"");
	return sString;
}

// expand Folder
function eF(f_iID)
{

	if (stBrowser.sType == "IELAYER" || stBrowser.sType == "DOM")
	{

		var obj;
		var objImg;
		var sImgType = "";
		
		obj = getObject("f" + f_iID);
		objImg = getObject("e" + f_iID);
	
		if (obj.style.display == "none")
		{
			obj.style.display = "";
			objImg.src = rootAdmin + "img/e/m.gif";
		
		}
		else
		{
			obj.style.display = "none"
			objImg.src = rootAdmin + "img/e/p.gif";
		
		} 	
	}
}	
// incl. folder icons
function eF2(f_iID)
{

	if (stBrowser.sType == "IELAYER" || stBrowser.sType == "DOM")
	{

		var obj;
		var objImg;
		var sImgType = "";
		
		obj = getObject("f" + f_iID);
		objImg = getObject("e" + f_iID);
		objImg2 = getObject("folder" + f_iID);
		
		if (obj.style.display == "none")
		{
			obj.style.display = "";
			objImg.src = rootAdmin + "img/e/m.gif";
			objImg2.src = rootAdmin + "img/e/f_a.gif";
		}
		else
		{
			obj.style.display = "none"
			objImg.src = rootAdmin + "img/e/p.gif";
			objImg2.src = rootAdmin + "img/e/f_n.gif";
		} 	
	}
}

function setError(f_oObject)
{
	f_oObject.className = f_oObject.className + "-error";
}

function selectCategoryUp(iCategoryID)
{
//	if (iSelection == 0)
//	{
		bChecked = getObject(iCategoryID).checked;
		obj = getObject(iCategoryID).nextSibling.nextSibling.nextSibling;
		if (obj.nodeName != "DIV")
		{
			obj = getObject(iCategoryID).nextSibling.nextSibling.nextSibling.nextSibling;
		}

		if (obj.nodeName == "DIV")
		{
			setCategoryUp(obj,bChecked);
		}
//	}
}	

function setCategoryUp(obj,f_bChecked)
{

	var obj2 = obj.childNodes;
	var i = 0;
	
	for(i = 0; i < obj2.length; i++)
	{
		if (obj2[i].nodeName == "INPUT")
		{
			obj2[i].checked = f_bChecked;
		}
		else if (obj2[i].nodeName == "DIV")
		{
			setCategoryUp(obj2[i],f_bChecked);
		}
	}
}


function selectCategoryDown(iCategoryID)
{
//	if (iSelection == 0)
//	{
		bChecked = getObject(iCategoryID).checked;
		obj = getObject(iCategoryID).parentNode.parentNode;
		alert(obj.value);
		/*
		if (obj.nodeName != "DIV")
		{
			obj = getObject(iCategoryID).nextSibling.nextSibling.nextSibling.nextSibling;
		}

		if (obj.nodeName == "DIV")
		{
			setCategoryDown(obj,bChecked);
		}
		*/
//	}
}	

function setCategoryDown(obj,f_bChecked)
{

	var obj2 = obj.childNodes;
	var i = 0;
	
	for(i = 0; i < obj2.length; i++)
	{
		if (obj2[i].nodeName == "INPUT")
		{
			obj2[i].checked = f_bChecked;
		}
		else if (obj2[i].nodeName == "DIV")
		{
			setCategoryDown(obj2[i],f_bChecked);
		}
	}
}

/* IE functions for disabled select options */
function optionsDisableIE()
{
    if (this.options[this.selectedIndex].disabled)
	{
		this.options[this.selectedIndex].selected = false;
		if (typeof this.selectedIndexPrev != "number") 
		{
			return;
		}
		this.options[this.selectedIndexPrev].selected = true;                    
	}
	else
	{
		this.selectedIndexPrev = this.selectedIndex;
	}
}

function checkSelectedIndexIE(obj)
{
	while (obj.options[obj.selectedIndex].disabled)
	{
		if (obj.options.length > obj.selectedIndex)
		{
			obj.selectedIndex += 1;
		}
		else
		{
			obj.selectedIndex = 0;
		}
	}
}

//--------------------------------------------------
/**
 * Application : image library
 * File        : _js/imageLibrary.js
 * @version    : 0.1
 * @author     : acn <acn@getunik.com>
 * @copyright  : copyright 05.07.2006 by http://www.getunik.com
 * 
 * Long desc:
 * Object oriented javascript function library to build a image library.
 * Take notice of the example created by acn@getunik.com.
 * 
 * Version-History:
 * 05.07.2006.getunik.acn : initial release
 */
 

/**
* main function to initiate a new image library object
*   - open a own data storage container, containig all informations for the image library
*
* @param  string  sImageLibraryName  the name of the image library. used to differ different image libraries od the same page.
* @param  array   aImageLibraryData  the data of the image library. format is not checked, must correspond to the example!
*/
function imageLibrary(sImageLibraryName, aImageLibraryData)
{
	if(typeof(sImageLibraryName) == 'string' && typeof(aImageLibraryData) == 'object' && sImageLibraryName != '' && aImageLibraryData.length > 0)
	{
		// save object specific data within the scope of 'this' object
		this.sImageLibraryName   = sImageLibraryName;
		this.aImageLibraryData   = aImageLibraryData;
		this.iActPos             = 0;
		this.iImageLibraryLength = aImageLibraryData.length
		this.aPrevImgs           = new Array();
		// generate preview image objects
		for(i in this.aImageLibraryData)
		{
			if(!isNaN(i))
			{
				if(this.aImageLibraryData[i]['previmgsrc'])
				{
					this.aPrevImgs[i]     = new Image();
					this.aPrevImgs[i].src = this.aImageLibraryData[i]['previmgsrc'];
				}
			}
		}
	}
	else
	{
		alert('imageLibrary.js\nError within imageLibrary():\nSubmitted data are corrupt!');
	}
}


/**
* set the visibility of the navigation buttons
*
* @param  string  sElementName  the id name of the object
* @param  array   sVisibility   the type of the new visibility status [visible|hidden]
*/
imageLibrary.prototype.setNavVisibility = function(sElementName, sVisibility)
{
	if(typeof(sElementName) == 'string' &&  typeof(sVisibility) == 'string')
	{
		if(document.getElementById(sElementName))
		{
			switch(sVisibility)
			{
				case "visible":
					document.getElementById(sElementName).style.visibility = "visible";
					break;
				case "hidden":
					document.getElementById(sElementName).style.visibility = "hidden";
					break;
				default:
					alert('imageLibrary.js\nError within setNavVisibility():\nVisibility value is wrong: \'' + sVisibility + '\'!');
					break;
			}
		}
		else
		{
			alert('imageLibrary.js\nError within setNavVisibility():\nElement id doesn\'t exist: \'' + sElementName + '\'!');
		}
	}
	else
	{
		alert('imageLibrary.js\nError within setNavVisibility():\nSubmitted data are corrupt!');	
	}
}


/**
* function to load the first object; use this as 'onload' statement
* within your html body tag, a.e.:
* <body onload="oMyImageLibrary.loadFirstObject();">
*/
imageLibrary.prototype.loadFirstObject = function()
{
	// load first image
	sImgName = this.sImageLibraryName + 'Image';
	if(document.getElementById(sImgName))
	{
		document.getElementById(sImgName).src    = this.aPrevImgs[this.iActPos].src;
		document.getElementById(sImgName).width  = this.aImageLibraryData[this.iActPos]['width'];
		document.getElementById(sImgName).height = this.aImageLibraryData[this.iActPos]['height'];
	}

	// load first description
	sDescriptionName = this.sImageLibraryName + 'Description';
	if(document.getElementById(sDescriptionName) && this.aImageLibraryData[this.iActPos]['description'] != "")
	{
		document.getElementById(sDescriptionName).firstChild.data = this.aImageLibraryData[this.iActPos]['description'];
	}
	
	// load first caption
	sCaptionName = this.sImageLibraryName + 'Caption';
	if(document.getElementById(sCaptionName) && this.aImageLibraryData[this.iActPos]['caption'] != "")
	{
		document.getElementById(sCaptionName).firstChild.data = this.aImageLibraryData[this.iActPos]['caption'];
	}
	
	// load e-card link text
	sLinkName = this.sImageLibraryName + 'ECard';
	if(document.getElementById(sLinkName) && this.aImageLibraryData[this.iActPos]['config']['bEcard'])
	{
		document.getElementById(sLinkName).firstChild.data = this.aImageLibraryData[this.iActPos]['config']['sEcardLinkText'];
	}
	
	// if only one (1) image is defined for the image library,
	// hide informations and navigation buttons
	if(this.iImageLibraryLength <= 1)
	{
		// hide actual position
		sActPos = this.sImageLibraryName + 'ActPos';
		this.setNavVisibility(sActPos, 'hidden');
		// just to ensure; hide the previous button
		sPrevious = this.sImageLibraryName + 'Previous';
		this.setNavVisibility(sPrevious, 'hidden');
		// just to esure; hide the next button
		sNext = this.sImageLibraryName + 'Next';
		this.setNavVisibility(sNext, 'hidden');
	}
	else
	{
		// display actual position
		sActPos = this.sImageLibraryName + 'ActPos';
		this.setNavVisibility(sActPos, 'visible');	
		sImagePos = this.sImageLibraryName + 'ImagePos';
		if(document.getElementById(sImagePos))
		{
			document.getElementById(sImagePos).firstChild.data = this.getActPosition();
		}
		// just to ensure; hide the previous button
		sPrevious = this.sImageLibraryName + 'Previous';
		this.setNavVisibility(sPrevious, 'hidden');
		// just to ensure; hide the next button
		sNext = this.sImageLibraryName + 'Next';
		this.setNavVisibility(sNext, 'visible');
	}
}


/**
* function to return the image position, a.e. '4 | 9'
*/
imageLibrary.prototype.getActPosition = function()
{
	iActPos = (this.iActPos <= 0) ? 1 : this.iActPos + 1;
	iActPos = (this.iActPos >= this.iImageLibraryLength) ? this.iImageLibraryLength : this.iActPos + 1;
	sPositionInformation = String(iActPos) + this.aImageLibraryData['config']['sActPosDelimiter'] + this.iImageLibraryLength;
	return sPositionInformation;
}


/**
* function to load the full view image of the actual object
* important notice: it use the function 'openPopUp' which is defined a.e. within 'openPopUp.js'!
*/
imageLibrary.prototype.getFullviewObject = function()
{
	if(this.aImageLibraryData[this.iActPos]['origimgsrc'] != "")
	{
		openPopUp(this.aImageLibraryData[this.iActPos]['origimgsrc'], this.aImageLibraryData['config']['PopUpWidth'], this.aImageLibraryData['config']['PopUpHeight'], this.aImageLibraryData['config']['PopUpToolbar'], this.aImageLibraryData['config']['PopUpScrollbars'], this.aImageLibraryData['config']['PopUpResizable']);
	}
}


/**
* function to turn the image library to the next object
*/
imageLibrary.prototype.getNextObject = function()
{
	if(this.iActPos < this.iImageLibraryLength - 1)
	{
		// eval the next pos
		this.iActPos = this.iActPos + 1;
		// load image
		sImgName = this.sImageLibraryName + 'Image';
		document.getElementById(sImgName).src    = this.aPrevImgs[this.iActPos].src;
		document.getElementById(sImgName).width  = this.aImageLibraryData[this.iActPos]['width'];
		document.getElementById(sImgName).height = this.aImageLibraryData[this.iActPos]['height'];
		// load description
		sDescriptionName = this.sImageLibraryName + 'Description';
		document.getElementById(sDescriptionName).firstChild.data = this.aImageLibraryData[this.iActPos]['description'];
		// load caption
		sCaptionName = this.sImageLibraryName + 'Caption';
		document.getElementById(sCaptionName).firstChild.data = this.aImageLibraryData[this.iActPos]['caption'];
		// display actual position
		sImagePos = this.sImageLibraryName + 'ImagePos';
		document.getElementById(sImagePos).firstChild.data = this.getActPosition();
		// manage visibility
		sNext     = this.sImageLibraryName + 'Next';
		sPrevious = this.sImageLibraryName + 'Previous';
		if(this.iActPos + 1 == this.iImageLibraryLength)
		{
			this.setNavVisibility(sNext, 'hidden');
			this.setNavVisibility(sPrevious, 'visible');
		}
		else
		{
			this.setNavVisibility(sNext, 'visible');
			this.setNavVisibility(sPrevious, 'visible');
		}
	}
}


/**
* function to turn the image library to the previous object
*/
imageLibrary.prototype.getPreviousObject = function()
{	
	if(this.iActPos <= this.iImageLibraryLength - 1)
	{
		// eval the next pos
		this.iActPos = this.iActPos - 1;
		if(this.iActPos < 0)
		{
			this.iActPos = 0;
		}
		// load image
		sImgName = this.sImageLibraryName + 'Image';
		document.getElementById(sImgName).src    = this.aPrevImgs[this.iActPos].src;
		document.getElementById(sImgName).width  = this.aImageLibraryData[this.iActPos]['width'];
		document.getElementById(sImgName).height = this.aImageLibraryData[this.iActPos]['height'];
		// load description
		sDescriptionName = this.sImageLibraryName + 'Description';
		document.getElementById(sDescriptionName).firstChild.data = this.aImageLibraryData[this.iActPos]['description'];
		// load caption
		sCaptionName = this.sImageLibraryName + 'Caption';
		document.getElementById(sCaptionName).firstChild.data = this.aImageLibraryData[this.iActPos]['caption'];
		// display actual position
		sImagePos = this.sImageLibraryName + 'ImagePos';
		document.getElementById(sImagePos).firstChild.data = this.getActPosition();
		// manage visibility
		sNext     = this.sImageLibraryName + 'Next';
		sPrevious = this.sImageLibraryName + 'Previous';
		if(this.iActPos <= 0)
		{
			this.setNavVisibility(sNext, 'visible');
			this.setNavVisibility(sPrevious, 'hidden');
		}
		else
		{
			this.setNavVisibility(sNext, 'visible');
			this.setNavVisibility(sPrevious, 'visible');
		}
	}
}



/**
 * function to call the ecard template with the corresponding image id (ximg.ximg_id)
 */
imageLibrary.prototype.getECard = function(sUrlECardTemplate)
{
	alert(sUrlECardTemplate);
}

//--------------------------------------------------
/* --------------------------------------------------------------------------------------------------------------
*	API:			JSMX (JavaScript MX) - Universal Ajax API for ColdFusion, PHP, .NET, or anything other language.
*	AUTHOR: 		Todd Kingham [todd@lalabird.com] with contributions by Jan Jannek [jan.jannek@Cetecom.de] and Yin Zhao [bugz_podder@yahoo.com]
*	CREATED:		8.21.2005
*	VERSION:		2.6.3
*	DESCRIPTION:	This API uses XMLHttpRequest to post/get data from a ColdFusion interface.
*					The CFC's/CFM's will return a string representation of a JS variable: response_param.
*					The "onreadystatechange event handler" will eval() the string into a JS variable 
*					and pass the value back to the "return function". To Download a full copy of the sample 
*					application visit: http://www.lalabird.com/JSMX/?fa=JSMX.downloads
*
*	HISTORY:		2.0.0:	Todd: Scripted Out Original Version
*					2.1.0:	Todd: Modified for Download
*					2.2.0:	Todd: Modified the firstWord() function to be backward compatable with
*								  CF5 and to be more stable all-around.
*					2.3.0:	Todd: Added "wait div" functionality
*					2.4.0:	Todd: XML!!!! Now JSMX will allow you to pass XML Documents to the API in
*								  addition to the original JavaScript method.
*					2.4.1:	Jan:  2006-02-16, XMLHTTP requests can now handle more than one request at once. By placing the onreadystatechange event as a local variable inside the actual http() function.
*							Jan:  Added fix for strange IE bug that returned Header Info.
*							Todd: Added the jsmx object to allow users to override defaults and set custom "async", "wait" and "error" methods
*					2.5.0:	Todd: Added JSON Support! So now you can pass JavaScript, XML, or JSON.
*					2.5.1:	Todd: Version 2.5.0 was premature. Needed to fix an eval() bug when I introduced JSON.
*					2.5.2:	Todd: Fixed a bug in the onreadystatechange. Based on the order you call the event handler... "State Change 1" gets called twice. Added code to only process code inside 'CASE 1:' once
*					2.5.3:	Todd: Fixed a bug in the try/catch of the parser by placing the callback() call within the try/catch statement. This caused errors in the callback function to be "masked" and appear as "parsing errors", even when the parse was successful.
*					2.6.0: 	Todd: Added WDDX Parser! Now you can return WDDX Strings as well.
*					2.6.1:	Todd: Streamlined the ClassicMode and JSON parser into one function.
*					2.6.2:	Todd: Replaced ParseInt() with ParseFloat() in the my WDDX Parser.
*							Yin: _escape_utf8() to allow UTF-8 Chars. (modified from Cal Henderson's <cal@iamcal.com> version)
*					2.6.3:	Todd: _escape_utf8() was choking on CR+LF: chr(13) && chr(10) ... modified function to correct problem.
*
*
*	LICENSE:		THIS IS AN OPEN SOURCE API. YOU ARE FREE TO USE THIS API IN ANY APPLICATION,
*               	TO COPY IT OR MODIFY THE FUNCTIONS FOR YOUR OWN NEEDS, AS LONG THIS HEADER INFORMATION
*              	 	REMAINS IN TACT AND YOU DON'T CHARGE ANY MONEY FOR IT. USE THIS API AT YOUR OWN
*               	RISK. NO WARRANTY IS EXPRESSED OR IMPLIED, AND NO LIABILITY ASSUMED FOR THE RESULT OF
*               	USING THIS API.
*
*               	THIS API IS LICENSED UNDER THE CREATIVE COMMONS ATTRIBUTION-SHAREALIKE LICENSE.
*               	FOR THE FULL LICENSE TEXT PLEASE VISIT: http://creativecommons.org/licenses/by-sa/2.5/
*
-----------------------------------------------------------------------------------------------------------------*/
// UNCOMMENT THE FOLLOWING LINE IF YOU WILL BE RETURNING QUERY OBJECTS. (note: you may need to point the SRC to an alternate location.
/*document.writeln('<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="/CFIDE/scripts/wddx.js"></SCRIPT >');*/

var jsmx = new jsmxConstructor();
function jsmxConstructor(){
	this.isJSMX = true;
	this.async = true;
	this.debug = false;
	this.waitDiv = 'JSMX_loading';
	this.http = http;
	this.onWait = _popWait;
	this.onWaitEnd = _killWait;
	this.onError = _onError;
}
// perform the XMLHttpRequest();
function http(verb,url,cb,q) {
	var self = (this.isJSMX) ? this : jsmx ;
	//reference our arguments
	var qryStr = (!q) ? '' : _toQueryString(q);
	var calledOnce = false; //this is to prevent a bug in onreadystatechange... "state 1" gets called twice.
	try{//this should work for most modern browsers excluding: IE Mac
		var xhr = ( window.XMLHttpRequest ) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP") ;
			xhr.onreadystatechange = function(){
				switch(xhr.readyState){
					case 1: 
						if(!calledOnce){ 
							self.onWait(self.waitDiv); 
							calledOnce = true;
						} 	break;
					case 2: break;
					case 3: break;
					case 4:
						self.onWaitEnd(self.waitDiv);
						if ( xhr.status == 200 ){// only if "OK"
							var success = true;
							try{
								var rObj = _parseResponse( xhr );
							}catch(e){ 
								self.onError(xhr,self,1);
								success = false;
							}
							if(success){ cb( rObj ); }
						}else{
							self.onError(xhr,self,2);
						}
					delete xhr; //clean this function from memory once we re done with it.
					break;
				}
			};
			xhr.open( verb , _noCache(url) , self.async );
			if(verb.toLowerCase() == 'post') { xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); }
			xhr.send(qryStr);
	}catch(e){
		self.onError(xhr,self,3);
	}
}

/*--- BEGIN: RESPONSE PARSING FUNCTIONS ---*/
function _parseResponse($$){
	 var str = _cleanString($$.responseText);
	 var xml = $$.responseXML;
	//FIRST TRY IT AS XML
		if(xml != null && xml.childNodes.length){ return xml; } 
	//NEXT TRY IT AS WDDX
		if(str.indexOf("<wddxPacket") == 0){ return _parseWDDX(str); }
	//NEXT TRY IT AS JSON
		try{ return eval('('+str+')'); }
	//NEXT TRY IT AS JavaScript
		catch(e){ return _parseJS(str); }
}
// jan.jannek@cetecom.de, 2006-02-16, weird error: some IEs show the responseText followed by the complete response (header and body again) 
function _cleanString(str){ 
	//Left Trim
	var rex = /\S/i;
	str = str.substring(str.search(rex),str.length);
	
	var i = str.indexOf("HTTP/1");
	if (i > -1) {
		str = str.substring(i, str.length);
		i = str.indexOf(String.fromCharCode(13, 10, 13, 10));
		if (i > -1) { str = str.substring(i + 2, str.length); }
	}
	return str;	
}
function _parseJS(str){ 
	eval(str);
	var r = eval(str.split('=')[0].replace(/\s/g,''));
	return r;
}
function _parseWDDX(str){ var wddx = xmlStr2Doc(str); var data = wddx.getElementsByTagName("data"); return _parseWDDXnode(data[0].firstChild); } function xmlStr2Doc(str){ var xml; if(typeof(DOMParser) == 'undefined'){ xml=new ActiveXObject("Microsoft.XMLDOM"); xml.async="false"; xml.loadXML(str); }else{ var domParser = new DOMParser(); xml = domParser.parseFromString(str, 'application/xml'); } return xml; } function _parseWDDXnode(n){ var val; switch(n.tagName){ case 'string': val = _parseWDDXstring(n); break; case 'number': val = parseFloat(n.firstChild.data); break; case 'boolean': val = n.getAttribute('value'); break; case 'dateTime': val = Date(n.firstChild.data); break; case 'array': val = _parseWDDXarray(n); break; case 'struct': val = _parseWDDXstruct(n); break; case 'recordset': val = _parseWDDXrecordset(n); break; case 'binary': val = n.firstChild.data; break; case 'char': val = _parseWDDXchar(n);; break; case 'null': val = ''; break; default: val = n.tagName; break; } return val; } function _parseWDDXstring(node){ var items = node.childNodes; var str = ''; for(var x=0;x < items.length;x++){ if(typeof(items[x].data) != 'undefined') str += items[x].data; else str += _parseWDDXnode(items[x]); } return str; } function _parseWDDXchar(node){ switch(node.getAttribute('code')){ case '0d': return '\r'; case '0c': return '\f'; case '0a': return '\n'; case '09': return '\t'; } } function _parseWDDXarray(node){ var items = node.childNodes; var arr = new Array(); for(var i=0;i < items.length;i++){ arr[i] = _parseWDDXnode(items[i]); } return arr; } function _parseWDDXstruct(node){ var items = node.childNodes; var obj = new Object(); for(var i=0;i < items.length;i++){ obj[items[i].getAttribute('name').toLowerCase()] = _parseWDDXnode(items[i].childNodes[0]); } return obj; } function _parseWDDXrecordset(node){ var qry = new Object(); var fields = node.getElementsByTagName("field"); var items; var dataType; var values; for(var x = 0; x < fields.length; x++){ items = fields[x].childNodes; values = new Array(); for(var i = 0; i < items.length; i++){ values[values.length] = _parseWDDXnode(items[i]); } qry[fields[x].getAttribute('name').toLowerCase()] = values; } return qry; }
/*--- END: RESPONSE PARSING FUNCTIONS ---*/


/*--- BEGIN: REQUEST PARAMETER FUNCTIONS ---*/
	function _toQueryString(obj){
		//determine the variable type
		if(typeof(obj) == 'string') { return obj; }
		if(typeof(obj) == 'object'){
			if(typeof obj.elements == 'undefined') {return _object2queryString(obj); }//It's an Object()!
			else{ return _form2queryString(obj); }//It's a form!
		}	
	}	
	function _object2queryString(obj){
		var ar = new Array();
		for(x in obj){ ar[ar.length] = _escape_utf8(x)+'='+_escape_utf8(obj[x]); }
		return ar.join('&');
	}	
	function _form2queryString(form){
		var obj = new Object();
		var ar = new Array();
		for(var i=0;i < form.elements.length;i++){
			try {
				elm = form.elements[i];
				nm = elm.name;
				if(nm != ''){
					switch(elm.type.split('-')[0]){
						case "select":
							for(var s=0;s < elm.options.length;s++){
								if(elm.options[s].selected){
									if(typeof(obj[nm]) == 'undefined'){ obj[nm] = new Array(); }
									obj[nm][obj[nm].length] = _escape_utf8(elm.options[s].value);
								}	
							}
							break;						
						case "radio":
							if(elm.checked){
								if(typeof(obj[nm]) == 'undefined'){ obj[nm] = new Array(); }
								obj[nm][obj[nm].length] = _escape_utf8(elm.value);
							}	
							break;						
						case "checkbox":
							if(elm.checked){
								if(typeof(obj[nm]) == 'undefined'){ obj[nm] = new Array(); }
								obj[nm][obj[nm].length] = _escape_utf8(elm.value);
							}	
							break;						
						default:
							if(typeof(obj[nm]) == 'undefined'){ obj[nm] = new Array(); }
							obj[nm][obj[nm].length] = _escape_utf8(elm.value);
							break;
					}
				}
			}catch(e){}
		}
		for(x in obj){ ar[ar.length] = x+'='+obj[x].join(','); }
	return ar.join('&');
	}
/*--- END: REQUEST PARAMETER FUNCTIONS ---*/

//IE likes to cache so we will fix it's wagon!
function _noCache(url){
	var qs = new Array();
	var arr = url.split('?');
	var scr = arr[0];
	if(arr[1]){ qs = arr[1].split('&'); }
	qs[qs.length]='noCache='+new Date().getTime();
return scr+'?'+qs.join('&');
}
function _popWait(id){ 
	proc = document.getElementById(id);
	if( proc == null ){
		var p = document.createElement("div");
		p.id = id;
		document.body.appendChild(p);
	}
}
function _killWait(id){
	proc = document.getElementById(id);
	if( proc != null ){ document.body.removeChild(proc); }
}
function _onError(obj,inst,errCode){ 
	var msg;
	switch(errCode){
		case 1:/*parsing error*/
			msg = (inst.debug) ? obj.responseText : 'Parsing Error: The value returned could not be evaluated.';
			break;
		case 2:/*server error*/
			msg = (inst.debug) ? obj.responseText : 'There was a problem retrieving the data:\n' + obj.status+' : '+obj.statusText;
			break;
		case 3:/*browser not equiped to handle XMLHttp*/
			msg = 'Unsupported browser detected.';
			return;/*you can remove this return to send a message to the screen*/
			break;		
	}		
	if(inst.debug){
		var debugWin = window.open('','error');
		debugWin.document.write(msg);
		debugWin.focus();
	}else{
		alert(msg);
	}
}

function _escape_utf8(data) {
	if (data=="" || data == null){ return ""; }
	data = data.toString();
	var buf = "";
	for (var i=0;i<data.length;i++) {
		var c=data.charCodeAt(i);
		var bs = [];				
		if (c>0x10000) {
			bs[0] = 0xF0 | ((c & 0x1C0000) >>> 18);
			bs[1] = 0x80 | ((c & 0x3F000) >>> 12);
			bs[2] = 0x80 | ((c & 0xFC0) >>> 6);
			bs[3] = 0x80 | (c & 0x3F);
		} else if (c>0x800) {
			bs[0] = 0xE0 | ((c & 0xF000) >>> 12);
			bs[1] = 0x80 | ((c & 0xFC0) >>> 6);
			bs[2] = 0x80 | (c & 0x3F);
		} else  if (c>0x80) {
			bs[0] = 0xC0 | ((c & 0x7C0) >>> 6);
			bs[1] = 0x80 | (c & 0x3F);
		}
		else{
			bs[0] = c;
		}
		
		if (c == 10 || c == 13){ buf += '%0'+c.toString(16); }//added to correct problem with hard returns
		else if (bs.length == 1 && c>=48 && c<127 && c!=92){buf += data.charAt(i);}
		else{ for(var j=0;j<bs.length;j++){ buf+='%'+bs[j].toString(16);} }
	}/**/
	return buf;
}
function $(id){ return document.getElementById(id); }
//--------------------------------------------------
function arrayToList(aArrayList)
{
	return aArrayList.join(",");
}

function listToArray(lListArray)
{
	return lListArray.split(",");
}

function listGetAt(lList,iPos)
{
	var sDelimiter = ",";
	if (arguments.length > 2)
	{
		sDelimiter = arguments[2];
	}
	var aList = lList.split(sDelimiter);

	if (iPos > 0 && iPos < aList.length+1)
	{
		return aList[iPos - 1];
	}
	else
	{
		return 0;
	}
}

function listSetAt(lList,iPos,sValue)
{
	var aList = lList.split(",");

	if (iPos > 0 && iPos < aList.length+1)
	{
		aList[iPos - 1] = sValue;
		return aList.join(",");
	}
	else
	{
		return lList;
	}	
}

function listDeleteAt(lList,iPos)
{
	var aList = lList.split(",");

	if(aList.length > 1)
	{ 
		if (iPos > 0 && iPos < aList.length+1)
		{
	
			if (sBrowser == "IE" && sVersion < "5.5")
			{
				if (aList.length > iPos)
				{
					for (i = iPos-1; i < aList.length-1; i++)
					{
						aList[i] = aList[i + 1];
					}
					
					aList.length --;
				}
				else
				{
					aList.length --;
				}	
			}
			else
			{
				aList.splice(iPos-1, 1);
			}	
			
			return aList.join(",");
		
		}
		else
		{
			return lList;
		}
	}
	else
	{
		return "";
	}		
}

function listFind(lList,sValue)
{
	var aList = lList.split(",");
	//alert(sValue.toLowerCase());
	
	for (i = 0; i < aList.length; i++)
	{
		if(sValue.toString().toLowerCase() == aList[i].toString().toLowerCase())
		{
			return i+1;
		}
	}
	return 0;
}

function listAppend(lList,sValue)
{

	if(lList.length > 0)
	{
		var aList = lList.split(",");
	
		/* keine doppelten hinzuf�gen
		for (i = 0; i < aList.length; i++)
		{
			if(sValue.toString().toLowerCase() == aList[i].toString().toLowerCase())
			{
				return i;
			}
		}
		*/
		
		if (sBrowser == "IE" && sVersion < "5.5")
		{
			aList.length ++;
			aList[aList.length-1] = sValue;
		}
		else
		{
			aList.push(sValue);
		}	
		
		
		return aList.join(",");
	}
	else
	{
		return sValue;
	}
}
//--------------------------------------------------
sOver = "a";
sNormal = "n";

function setClass(f_obj)
{
	if (stBrowser.sType == "IELAYER" || stBrowser.sType == "DOM")
	{
		
		sClassName = f_obj.className;
		sMainClassName = sClassName.substr(0,sClassName.length-1);
		sEndClassName = sClassName.substr(sMainClassName.length,sClassName.length);
	
		if (sEndClassName == sNormal)
		{
			f_obj.className = sMainClassName + sOver;
			setCursor(f_obj);
		}
		else
		{
			f_obj.className = sMainClassName + sNormal;
		}
	
	}
	
}

function setClassName(f_sObj)
{
	if (stBrowser.sType == "IELAYER" || stBrowser.sType == "DOM")
	{
		obj = getObject(f_sObj);
		sClassName = obj.className;
		sMainClassName = sClassName.substr(0,sClassName.length-1);
		sEndClassName = sClassName.substr(sMainClassName.length,sClassName.length);
		
		if (sEndClassName == sNormal)
		{
			obj.className = sMainClassName + sOver;
			setCursor(obj);
		}
		else
		{
			obj.className = sMainClassName + sNormal;
		}
	
	}
	
}

function setCursor(f_obj)
{

	if (stBrowser.sBrowser == "NS")
	{
		f_obj.style.cursor  = "pointer";
	}
	else
	{
		f_obj.style.cursor  = "hand";
	}
}

function setCursorNormal(f_obj)
{
	if (stBrowser.sBrowser == "NS")
	{
		f_obj.style.cursor  = "";
	}
	else
	{
		f_obj.style.cursor  = "";
	}
}

function setLoc(f_sLoc)
{
	document.location.href=f_sLoc;
}

function setExpColor(f_sObj,f_iSwitch)
{
	if (stBrowser.sType == "IELAYER" || stBrowser.sType == "DOM")
	{
		if (f_iSwitch == 0)
		{
			f_sObj.style.backgroundColor = "";
		}
		else
		{
			f_sObj.style.backgroundColor = "FDB15D";
		}
	}
}
// wie setExpColor, nur funktionsaufruf kleiner 

function sC(f_sObj,f_iSwitch)
{
	if (stBrowser.sType == "IELAYER" || stBrowser.sType == "DOM")
	{
		if (f_iSwitch == 0)
		{
			f_sObj.style.backgroundColor = "";
		}
		else
		{
			f_sObj.style.backgroundColor = "FDB15D";
		}
	}
}

//--------------------------------------------------
/**
 * Application : CF WCMS CORE
 * File        : _js/openPopUp.js
 * @version    : 1.0
 * @author     : acn <acn@getunik.com>
 * @copyright  : copyright 01.01.2000 by http://www.getunik.com
 * 
 * Long desc:
 * Function library to enable to open a new browser window (aka popup)
 * with a assigned behaviour (see parameter list).
 * The function checks if already a popup with the same name exists.<b> 
 * If a popup with the same name exists, it close-it first.
 *
 * Version-History:
 * 01.01.2000.private.acn : initial release
 */
 

/**
 * main function to open a popup window by entered specificas
 *   - check if a old window instance exists - close this first before open a new one 
 *   - use the function openWin() to setup a new window instance
 *
 * @param  string   sUrl         the source file for the window instance
 * @param  intiger  iWidth       width of the new window (0 - n)
 * @param  intiger  iHeight      height of the new window (0 - n)
 * @param  intiger  bToolbar     toolbar displayed or not (0|1)
 * @param  intiger  bScrollbars  scrollbars displayed or not (0|1)
 * @param  intiger  bResizable   windwo by user resizable or not (0|1)
 */
function openPopUp(sUrl, iWidth, iHeight, bToolbar, bScrollbars, bResizable){  
  if(window.popup){
    if(!(popup.closed)){
      popup.close();
	}
    openWin(sUrl, iWidth, iHeight, bToolbar, bScrollbars, bResizable);
  }
  else{
    openWin(sUrl, iWidth, iHeight, bToolbar, bScrollbars, bResizable);
  }
}

/**
 * sub function used within the function openPopUp()
 *
 * @param  string   sUrl         the source file for the window instance
 * @param  intiger  iWidth       width of the new window (0 - n)
 * @param  intiger  iHeight      height of the new window (0 - n)
 * @param  intiger  bToolbar     toolbar displayed or not (0|1)
 * @param  intiger  bScrollbars  scrollbars displayed or not (0|1)
 * @param  intiger  bResizable   windwo by user resizable or not (0|1)
 */
function openWin(sUrl, iWidth, iHeight, bToolbar, bScrollbars, bResizable){
  popup = window.open(sUrl, "PopUp","toolbar=" + bToolbar + ",location=0,directories=0,status=0,menubar=0,scrollbars=" + bScrollbars +",resizable=" + bResizable + ",width=" + iWidth + ",height=" + iHeight);
  if (navigator.appName == "Microsoft Internet Explorer"){
    popup.resizeTo((parseInt(iWidth)+10),(parseInt(iHeight)+50));
  }
  else{
    popup.resizeTo(iWidth, iHeight);
  }
  if(navigator.userAgent.indexOf("Mozilla/3.0") != -1  || navigator.userAgent.indexOf("Mozilla/4.0") != -1){
    popup.focus();
  }
}
//--------------------------------------------------
/**
 * Application : CF WCMS CORE
 * File        : _js/swfLiveConnect.js
 * @version    : 0.1
 * @author     : acn <acn@getunik.com>
 * @copyright  : copyright 17.07.2006 by http://www.getunik.com
 * 
 * Long desc:
 * Object oriented javascript function library to communicate with flash variables.
 * Please recognise that the flash variables must be accordingly prepared!
 *
 * Version-History:
 * 17.07.2006.getunik.acn : initial release
 */


/**
 * main function to initiate a new swf object
 *   - open a own data storage container, containing the specified swf movie as an object.
 *
 * @param  string  sSwfObjectName  the name oft the html element id containing the swf embed code 
 */
function swfLiveConnect(sSwfObjectName)
{
	
	this.sSwfObjectName = "";
	this.oSwfObject     = new Object();
	this.bProcStat      = false;
	this.bSwfDone       = false;
	
	if(sSwfObjectName != undefined && sSwfObjectName != '' || typeof(sSwfObjectName) == 'string')
	{
		this.sSwfObjectName = sSwfObjectName;
		
		// initiate the flash movie as js object depending on browser version
		// ie
		if(!this.bSwfDone)
		{
			if(document.all)
			{
				if(document.all[this.sSwfObjectName]){
					this.oSwfObject = document.all[this.sSwfObjectName];
					this.bSwfDone = true;
				}
				// opera
				if(window.opera)
				{
					var movie = eval(window.document + this.sSwfObjectName);
			    if(movie.SetVariable)
					{
						this.oSwfObject = movie;
						this.bSwfDone = true;
					}
				}
				return;
			}
		}
		
		// netscape
		if(!this.bSwfDone)
		{
			if(document.layers)
			{
				if(document.embeds)
				{
					var movie = document.embeds[this.sSwfObjectName];
					if(movie.SetVariable)
					{
						this.oSwfObject = movie;
						this.bSwfDone = true;
					}
				}
				return;
			}
		}
		
		// firefox
		if(!this.bSwfDone)
		{
			if(document.getElementById)
			{
				var movie = document.getElementById(this.sSwfObjectName);
				if(movie.SetVariable)
				{
					this.oSwfObject = movie;
					this.bSwfDone = true;
				}
				return;
			}
		}
		
		if(!this.bSwfDone)
		{
			alert('swfLiveConnect.js\nError within swfLiveConnect():\nProblem to initiate the object \'oSwfObject\'!');
			this.bProcStat = false;
		}
		else
		{
			this.bProcStat = true;
		}
		
	}
	else
	{
		alert('swfLiveConnect.js\nError within swfLiveConnect():\nSubmitted data are corrupt!');
	}
}


/**
 * function to set swf variables, using the object initiated by 'swfLiveConnect()'
 *
 * @param  string  sParamName   the name of the parameter which should be set
 * @param  string  sParamValue  the value of the parameter which should be set
 */
swfLiveConnect.prototype.setSwfParam = function(sParamName, sParamValue)
{
	if(sParamName != undefined && sParamName != '' && typeof(sParamName) == 'string' && sParamValue != undefined)
	{
		this.oSwfObject.SetVariable(sParamName, sParamValue);
	}
	else
	{
		alert('swfLiveConnect.js\nError within setSwfParam():\nSubmitted data are corrupt!');
	}
}


/**
 * function to get swf variables, using the object initiated by 'swfLiveConnect()'
 *
 * @param  string  sParamName  the name of the parameter which should be readed
*/
swfLiveConnect.prototype.getSwfParam = function(sParamName)
{
	if(sParamName != undefined && sParamName != '' && typeof(sParamName) == 'string')
	{
		sSwfParamValue = "";
		sSwfParamValue = this.oSwfObject.GetVariable(sParamName);
		return sSwfParamValue;
	}
	else
	{
		alert('swfLiveConnect.js\nError within getSwfParam():\nPlease specify the param name!');
	}
}
//--------------------------------------------------
/**
 * SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){
_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}
return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){
var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){
return q.substring(q.indexOf("=",_2d)+1,_2e);
}}return "";}};
if(Array.prototype.push==null){
Array.prototype.push=function(_2f){
this[this.length]=_2f;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject; // for backwards compatibility
var SWFObject=deconcept.SWFObject;


//--------------------------------------------------
/* 
Methods for resizing the flash stage at runtime.

setFlashWidth(divid, newW)
divid: id of the div containing the flash movie.
newW: new width for flash movie

setFlashWidth(divid, newH)
divid: id of the div containing the flash movie.
newH: new height for flash movie

setFlashSize(divid, newW, newH)
divid: id of the div containing the flash movie.
newW: new width for flash movie
newH: new height for flash movie

canResizeFlash()
returns true if browser supports resizing flash, false if not. 
*/
function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}
function setFlashHeight(divid, newH){
	document.getElementById(divid).style.height = newH+"px";		
}
function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}
function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}
//--------------------------------------------------
/*	Unobtrusive Flash Objects (UFO) v3.20 <http://www.bobbyvandersluis.com/ufo/>
	Copyright 2005, 2006 Bobby van der Sluis
	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/

var UFO = {
	req: ["movie", "width", "height", "majorversion", "build"],
	opt: ["play", "loop", "menu", "quality", "scale", "salign", "wmode", "bgcolor", "base", "flashvars", "devicefont", "allowscriptaccess", "seamlesstabbing"],
	optAtt: ["id", "name", "align"],
	optExc: ["swliveconnect"],
	ximovie: "ufo.swf",
	xiwidth: "215",
	xiheight: "138",
	ua: navigator.userAgent.toLowerCase(),
	pluginType: "",
	fv: [0,0],
	foList: [],
		
	create: function(FO, id) {
		if (!UFO.uaHas("w3cdom") || UFO.uaHas("ieMac")) return;
		UFO.getFlashVersion();
		UFO.foList[id] = UFO.updateFO(FO);
		UFO.createCSS("#" + id, "visibility:hidden;");
		UFO.domLoad(id);
	},

	updateFO: function(FO) {
		if (typeof FO.xi != "undefined" && FO.xi == "true") {
			if (typeof FO.ximovie == "undefined") FO.ximovie = UFO.ximovie;
			if (typeof FO.xiwidth == "undefined") FO.xiwidth = UFO.xiwidth;
			if (typeof FO.xiheight == "undefined") FO.xiheight = UFO.xiheight;
		}
		FO.mainCalled = false;
		return FO;
	},

	domLoad: function(id) {
		var _t = setInterval(function() {
			if ((document.getElementsByTagName("body")[0] != null || document.body != null) && document.getElementById(id) != null) {
				UFO.main(id);
				clearInterval(_t);
			}
		}, 250);
		if (typeof document.addEventListener != "undefined") {
			document.addEventListener("DOMContentLoaded", function() { UFO.main(id); clearInterval(_t); } , null); // Gecko, Opera 9+
		}
	},

	main: function(id) {
		var _fo = UFO.foList[id];
		if (_fo.mainCalled) return;
		UFO.foList[id].mainCalled = true;
		document.getElementById(id).style.visibility = "hidden";
		if (UFO.hasRequired(id)) {
			if (UFO.hasFlashVersion(parseInt(_fo.majorversion, 10), parseInt(_fo.build, 10))) {
				if (typeof _fo.setcontainercss != "undefined" && _fo.setcontainercss == "true") UFO.setContainerCSS(id);
				UFO.writeSWF(id);
			}
			else if (_fo.xi == "true" && UFO.hasFlashVersion(6, 65)) {
				UFO.createDialog(id);
			}
		}
		document.getElementById(id).style.visibility = "visible";
	},
	
	createCSS: function(selector, declaration) {
		var _h = document.getElementsByTagName("head")[0]; 
		var _s = UFO.createElement("style");
		if (!UFO.uaHas("ieWin")) _s.appendChild(document.createTextNode(selector + " {" + declaration + "}")); // bugs in IE/Win
		_s.setAttribute("type", "text/css");
		_s.setAttribute("media", "screen"); 
		_h.appendChild(_s);
		if (UFO.uaHas("ieWin") && document.styleSheets && document.styleSheets.length > 0) {
			var _ls = document.styleSheets[document.styleSheets.length - 1];
			if (typeof _ls.addRule == "object") _ls.addRule(selector, declaration);
		}
	},
	
	setContainerCSS: function(id) {
		var _fo = UFO.foList[id];
		var _w = /%/.test(_fo.width) ? "" : "px";
		var _h = /%/.test(_fo.height) ? "" : "px";
		UFO.createCSS("#" + id, "width:" + _fo.width + _w +"; height:" + _fo.height + _h +";");
		if (_fo.width == "100%") {
			UFO.createCSS("body", "margin-left:0; margin-right:0; padding-left:0; padding-right:0;");
		}
		if (_fo.height == "100%") {
			UFO.createCSS("html", "height:100%; overflow:hidden;");
			UFO.createCSS("body", "margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;");
		}
	},

	createElement: function(el) {
		return (UFO.uaHas("xml") && typeof document.createElementNS != "undefined") ?  document.createElementNS("http://www.w3.org/1999/xhtml", el) : document.createElement(el);
	},

	createObjParam: function(el, aName, aValue) {
		var _p = UFO.createElement("param");
		_p.setAttribute("name", aName);	
		_p.setAttribute("value", aValue);
		el.appendChild(_p);
	},

	uaHas: function(ft) {
		var _u = UFO.ua;
		switch(ft) {
			case "w3cdom":
				return (typeof document.getElementById != "undefined" && typeof document.getElementsByTagName != "undefined" && (typeof document.createElement != "undefined" || typeof document.createElementNS != "undefined"));
			case "xml":
				var _m = document.getElementsByTagName("meta");
				var _l = _m.length;
				for (var i = 0; i < _l; i++) {
					if (/content-type/i.test(_m[i].getAttribute("http-equiv")) && /xml/i.test(_m[i].getAttribute("content"))) return true;
				}
				return false;
			case "ieMac":
				return /msie/.test(_u) && !/opera/.test(_u) && /mac/.test(_u);
			case "ieWin":
				return /msie/.test(_u) && !/opera/.test(_u) && /win/.test(_u);
			case "gecko":
				return /gecko/.test(_u) && !/applewebkit/.test(_u);
			case "opera":
				return /opera/.test(_u);
			case "safari":
				return /applewebkit/.test(_u);
			default:
				return false;
		}
	},
	
	getFlashVersion: function() {
		if (UFO.fv[0] != 0) return;  
		if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object") {
			UFO.pluginType = "npapi";
			var _d = navigator.plugins["Shockwave Flash"].description;
			if (typeof _d != "undefined") {
				_d = _d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				var _m = parseInt(_d.replace(/^(.*)\..*$/, "$1"), 10);
				var _r = /r/.test(_d) ? parseInt(_d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
				UFO.fv = [_m, _r];
			}
		}
		else if (window.ActiveXObject) {
			UFO.pluginType = "ax";
			try { // avoid fp 6 crashes
				var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
			}
			catch(e) {
				try { 
					var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
					UFO.fv = [6, 0];
					_a.AllowScriptAccess = "always"; // throws if fp < 6.47 
				}
				catch(e) {
					if (UFO.fv[0] == 6) return;
				}
				try {
					var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				}
				catch(e) {}
			}
			if (typeof _a == "object") {
				var _d = _a.GetVariable("$version"); // bugs in fp 6.21/6.23
				if (typeof _d != "undefined") {
					_d = _d.replace(/^\S+\s+(.*)$/, "$1").split(",");
					UFO.fv = [parseInt(_d[0], 10), parseInt(_d[2], 10)];
				}
			}
		}
	},

	hasRequired: function(id) {
		var _l = UFO.req.length;
		for (var i = 0; i < _l; i++) {
			if (typeof UFO.foList[id][UFO.req[i]] == "undefined") return false;
		}
		return true;
	},
	
	hasFlashVersion: function(major, release) {
		return (UFO.fv[0] > major || (UFO.fv[0] == major && UFO.fv[1] >= release)) ? true : false;
	},

	writeSWF: function(id) {
		var _fo = UFO.foList[id];
		var _e = document.getElementById(id);
		if (UFO.pluginType == "npapi") {
			if (UFO.uaHas("gecko") || UFO.uaHas("xml")) {
				while(_e.hasChildNodes()) {
					_e.removeChild(_e.firstChild);
				}
				var _obj = UFO.createElement("object");
				_obj.setAttribute("type", "application/x-shockwave-flash");
				_obj.setAttribute("data", _fo.movie);
				_obj.setAttribute("width", _fo.width);
				_obj.setAttribute("height", _fo.height);
				var _l = UFO.optAtt.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[UFO.optAtt[i]] != "undefined") _obj.setAttribute(UFO.optAtt[i], _fo[UFO.optAtt[i]]);
				}
				var _o = UFO.opt.concat(UFO.optExc);
				var _l = _o.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[_o[i]] != "undefined") UFO.createObjParam(_obj, _o[i], _fo[_o[i]]);
				}
				_e.appendChild(_obj);
			}
			else {
				var _emb = "";
				var _o = UFO.opt.concat(UFO.optAtt).concat(UFO.optExc);
				var _l = _o.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[_o[i]] != "undefined") _emb += ' ' + _o[i] + '="' + _fo[_o[i]] + '"';
				}
				_e.innerHTML = '<embed type="application/x-shockwave-flash" src="' + _fo.movie + '" width="' + _fo.width + '" height="' + _fo.height + '" pluginspage="http://www.macromedia.com/go/getflashplayer"' + _emb + '></embed>';
			}
		}
		else if (UFO.pluginType == "ax") {
			var _objAtt = "";
			var _l = UFO.optAtt.length;
			for (var i = 0; i < _l; i++) {
				if (typeof _fo[UFO.optAtt[i]] != "undefined") _objAtt += ' ' + UFO.optAtt[i] + '="' + _fo[UFO.optAtt[i]] + '"';
			}
			var _objPar = "";
			var _l = UFO.opt.length;
			for (var i = 0; i < _l; i++) {
				if (typeof _fo[UFO.opt[i]] != "undefined") _objPar += '<param name="' + UFO.opt[i] + '" value="' + _fo[UFO.opt[i]] + '" />';
			}
			var _p = window.location.protocol == "https:" ? "https:" : "http:";
			_e.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + _objAtt + ' width="' + _fo.width + '" height="' + _fo.height + '" codebase="' + _p + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + _fo.majorversion + ',0,' + _fo.build + ',0"><param name="movie" value="' + _fo.movie + '" />' + _objPar + '</object>';
		}
	},
		
	createDialog: function(id) {
		var _fo = UFO.foList[id];
		UFO.createCSS("html", "height:100%; overflow:hidden;");
		UFO.createCSS("body", "height:100%; overflow:hidden;");
		UFO.createCSS("#xi-con", "position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;");
		UFO.createCSS("#xi-dia", "position:absolute; left:50%; top:50%; margin-left: -" + Math.round(parseInt(_fo.xiwidth, 10) / 2) + "px; margin-top: -" + Math.round(parseInt(_fo.xiheight, 10) / 2) + "px; width:" + _fo.xiwidth + "px; height:" + _fo.xiheight + "px;");
		var _b = document.getElementsByTagName("body")[0];
		var _c = UFO.createElement("div");
		_c.setAttribute("id", "xi-con");
		var _d = UFO.createElement("div");
		_d.setAttribute("id", "xi-dia");
		_c.appendChild(_d);
		_b.appendChild(_c);
		var _mmu = window.location;
		if (UFO.uaHas("xml") && UFO.uaHas("safari")) {
			var _mmd = document.getElementsByTagName("title")[0].firstChild.nodeValue = document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0, 47) + " - Flash Player Installation";
		}
		else {
			var _mmd = document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		}
		var _mmp = UFO.pluginType == "ax" ? "ActiveX" : "PlugIn";
		var _uc = typeof _fo.xiurlcancel != "undefined" ? "&xiUrlCancel=" + _fo.xiurlcancel : "";
		var _uf = typeof _fo.xiurlfailed != "undefined" ? "&xiUrlFailed=" + _fo.xiurlfailed : "";
		UFO.foList["xi-dia"] = { movie:_fo.ximovie, width:_fo.xiwidth, height:_fo.xiheight, majorversion:"6", build:"65", flashvars:"MMredirectURL=" + _mmu + "&MMplayerType=" + _mmp + "&MMdoctitle=" + _mmd + _uc + _uf };
		UFO.writeSWF("xi-dia");
	},

	expressInstallCallback: function() {
		var _b = document.getElementsByTagName("body")[0];
		var _c = document.getElementById("xi-con");
		_b.removeChild(_c);
		UFO.createCSS("body", "height:auto; overflow:auto;");
		UFO.createCSS("html", "height:auto; overflow:auto;");
	},

	cleanupIELeaks: function() {
		var _o = document.getElementsByTagName("object");
		var _l = _o.length
		for (var i = 0; i < _l; i++) {
			_o[i].style.display = "none";
			for (var x in _o[i]) {
				if (typeof _o[i][x] == "function") {
					_o[i][x] = null;
				}
			}
		}
	}

};

if (typeof window.attachEvent != "undefined" && UFO.uaHas("ieWin")) {
	window.attachEvent("onunload", UFO.cleanupIELeaks);
}

//--------------------------------------------------
/**
 * Application : CF WCMS CUSTOM CORE
 * File        : _js/umt.js
 * @version    : 0.1
 * @author     : acn <acn@getunik.com>
 * @copyright  : copyright 03.11.2006 by http://www.getunik.com
 * 
 * Long desc:
 * Object oriented javascript function library which provide several methods in the context of the UMT.
 *
 * Version-History:
 * 03.11.2006.getunik.acn : initial release
 * 28.11.2006.getunik.acn : several functions within the context of user administration added
 * 01.12.2006.getunik.acn : functions for moving options from one to a other select box added
 */


/**
 * main function to initiate a new umt object
 *
 * @param  object  oFormDomObject  the DOM object oft the html form from which data are gathered and manipulated. 
 */
function umt(oFormDomObject)
{
	
	// internal definitions, a.e. error messages
	this.sFileName       = "- umt.js -\n";
	this.iErrorId        = 0;
	this.aErrorMsg       = new Array();
	this.aErrorMsg[0]    = this.sFileName + "OK!";
	this.aErrorMsg[1]    = this.sFileName + "Unable to initiate the HTML form as a JS object!";
	this.aErrorMsg[2]    = "Please select a CSV file for upload!";
	this.aErrorMsg[3]    = "Please define a number for the start row!";
	this.aErrorMsg[4]    = "Please define a number greater or equals then 1 for the start row!";
	this.aErrorMsg[5]    = "Please insert the username!";
	this.aErrorMsg[6]    = "Please insert a password!";
	this.aErrorMsg[7]    = "The password must contain at least 6 characters!";
	this.aErrorMsg[8]    = "The retyped password is wrong!";
	this.aErrorMsg[9]    = "Please insert the firstname!";
	this.aErrorMsg[10]   = "Please insert the lastname!";
	this.aErrorMsg[11]   = "Please insert the residential address!";
	this.aErrorMsg[12]   = "Please insert the ZIP!";
	this.aErrorMsg[13]   = "Please insert the city!";
	this.aErrorMsg[14]   = "Please select the country!";
	this.aErrorMsg[15]   = "Please insert the e-mail address!";
	this.aErrorMsg[16]   = "Please insert a correct e-mail address!";
	this.aErrorMsg[17]   = "As photosource there are only GIF, JPEG or PNG files possible!";
	this.aErrorMsg[18]   = "Form action is not supported!";
	this.aImageFormat    = new Array();
	this.aImageFormat[0] = "jpg";
	this.aImageFormat[1] = "jpeg";
	this.aImageFormat[2] = "gif";
	this.aImageFormat[3] = "png";
	
	// internal data
	this.oForm     = new Object();
	this.bProcStat = false;
	
	// pretreat data
	if(oFormDomObject == undefined || oFormDomObject == '' || typeof(oFormDomObject) != 'object')
	{
		if(document.forms[0])
		{
			this.oForm     = document.forms[0];
			this.bProcStat = true;
		}
	}
	else
	{
		this.oForm     = oFormDomObject;
		this.bProcStat = true;
	}
	
	if(this.oForm == undefined || this.oForm == '' || typeof(this.oForm) != 'object')
	{
		this.bProcStat = false;
		this.iErrorId  = 1;
		alert(this.aErrorMsg[this.iErrorId]);
	}
	
} // eof umt()


/**
 * build a random string
 */
umt.prototype.randomString = function()
{
	
	// internal data
	var sChars        = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var istringLength = 8;
	var sRandomString = "";
	
	// build random string
	for(var i=0; i<istringLength; i++)
	{
		var iRandomPos = Math.floor(Math.random() * sChars.length);
		sRandomString += sChars.substring(iRandomPos, iRandomPos+1);
	}
	
	// return random string
	return sRandomString;
	
} // eof randomString


/**
 * trim a string as known from other programming languages like PHP or JAVA,
 * removes whitespaces at the beginning and ending of sString
 * 
 * @param  string  sString  string for treatment
 */
umt.prototype.trimString = function(sString)
{
	
	// trim string by using regexp
	sString = sString.replace(/^\s+|\s+$/g, "");
	
	// return trimmed string
	return sString;
	
} // eof trimString



/**
 * change the visibility status of the layer
 * 
 * @param  string  sLayerName  the id of the layer for which the visibility has to be changed (id="myLayer").
 */
umt.prototype.changeVisibility = function(sLayerName)
{
	
	// check which DOM model
	if(document.layers)
	{
		// change visibility
		var visi = document.layers[sLayerName].visibility;
		(visi == "hide") ? document.layers[sLayerName].visibility = "show" : document.layers[sLayerName].visibility = "hide";
	}
	else if(document.getElementById)
	{
		// change visibility
		var visi = document.getElementById(sLayerName).style.visibility;
		(visi == "hidden") ? document.getElementById(sLayerName).style.visibility = "visible" : document.getElementById(sLayerName).style.visibility = "hidden";
	}
	else if(document.all)
	{
		// change visibility
		var visi = document.all[sLayerName].style.visibility;
		(visi == "hidden") ? document.all[sLayerName].style.visibility = "visible" : document.all[sLayerName].style.visibility = "hidden";
	}
	
} // eof changeVisibility



/**
 * move selected select box option from one select box to the other
 * 
 * @param  string  sSelectNameFrom  name of the select box from which selected option should be removed
 * @param  string  sSelectNameTo    name of the select box on which the selected option should be added
 */
umt.prototype.selectMoveFromTo = function(sSelectNameFrom, sSelectNameTo)
{
	
	// if select boxes exists
	if(this.bProcStat && this.oForm.elements[sSelectNameFrom] && this.oForm.elements[sSelectNameTo])
	{
		// loop options
		for(i=0; i<this.oForm.elements[sSelectNameFrom].length; i++)
		{
			// check if option is selected ...
			if(this.oForm.elements[sSelectNameFrom].options[i].selected)
			{
				// ... save text and value for further processing
				sText  = this.oForm.elements[sSelectNameFrom].options[i].text;
				sValue = this.oForm.elements[sSelectNameFrom].options[i].value;
				// ... delete option from the actual select box
				this.oForm.elements[sSelectNameFrom].options[i] = null;
				// ... and add-it if its not the default option (value="0") to the target select box
				if(sValue != 0)
				{
					oNewOption = new Option(sText, sValue);
					this.oForm.elements[sSelectNameTo].options[this.oForm.elements[sSelectNameTo].length] = oNewOption;
				}
			}
		}
	}
	
} // eof selectMoveFromTo


/**
 * set the default option within a select box
 * 
 * @param  string   sSelectName       the name of the selectbox
 * @param  string   sText             visible text of the new option
 * @param  string   sValue            hidden value of the new option
 * @param  integer  iIdx              optional (default: 0); index of the option within the select box
 * @param  boolean  bDefaultSelected  optional (default: false); defines if the options should be the per default selected option
 * @param  boolean  bSelected         optional (default: false); defines if the new options should be selected or not
 */
umt.prototype.selectSetDefault = function(sSelectName, sText, sValue, iIdx, bDefaultSelected, bSelected)
{
	
	iFIdx             = 0;
	bFDefaultSelected = false;
	bFSelected        = false;
	
	// if select box exists but she is empty
	if(this.bProcStat && this.oForm.elements[sSelectName] && this.oForm.elements[sSelectName].length == 0 && arguments.length >= 2)
	{
			
		// if optional paramters are set
		if(arguments.length > 3)
		{
			// treat paramters
			for(i=3; i<arguments.length; i++)
			{
				alert(i + "/" + arguments.length + " : " + arguments[i]);
				if(i == 3)
				{
					iFIdx = iIdx;
				}
				if(i == 4)
				{
					bFDefaultSelected = bDefaultSelected;
				}
				if(i == 5)
				{
					bFSelected = bSelected;
				}
			}
		}
		
		// create new option
		oNewOption = new Option(sText, sValue, bFDefaultSelected, bFSelected);
		// add-it to the select box
		this.oForm.elements[sSelectName].options[iFIdx] = oNewOption;
			
	}
	
} // eof selectSetDefault


/**
 * remove default options in select boxes when adding a value from a source select box
 * 
 * @param  string   sSelectNameFrom  the name of the source box (needed for check)
 * @param  string   sSelectNameTo    name of the target select box
 * @param  integer  iIdx             index of the option within the select box which should be replaced
 * @param  string   sText            optional (default: ""); visible text of existing option. when set, check before removement if text is equals or not
 * @param  string   sValue           optional (default: ""); hidden value of existing option. when set, check before removement if value is equals or not
 */
umt.prototype.selectRemoveDefault = function(sSelectNameFrom, sSelectNameTo, iIdx, sText, sValue)
{
	sFText      = "";
	bCheckText  = false;
	sFValue     = "";
	bCheckValue = false;
	bCheck      = false;
	
	// if select box exists
	if(this.bProcStat && this.oForm.elements[sSelectNameTo] && arguments.length >= 3)
	{
		bSelected = false
		// check if at the source select box at least one option is selected
		for(i=0; i<this.oForm.elements[sSelectNameFrom].length; i++)
		{
			if(this.oForm.elements[sSelectNameFrom].options[i].selected)
			{
				bSelected = true;
				break;
			}
		}
		// if at least one option is selected, process
		if(bSelected)
		{
			// if there are optional parameters, remember them for further processing
			for(i=3; i<arguments.length; i++)
			{
				if(i == 3)
				{
					sFText     = sText;
					bCheckText = true;
				}
				if(i == 4)
				{
					sFValue     = sValue;
					bCheckValue = true;
				}
			}
			if(this.oForm.elements[sSelectNameTo].options[iIdx])
			{
				bCheck = true;
			}
			// if optional parameter is set, check
			if(bCheck && bCheckText)
			{
				if(this.oForm.elements[sSelectNameTo].options[iIdx].text == sFText)
				{
					bCheck = true;
				}
				else
				{
					bCheck = false;
				}
			}
			if(bCheck && bCheckValue)
			{
				if(this.oForm.elements[sSelectNameTo].options[iIdx].value == sFValue)
				{
					bCheck = true;
				}
				else
				{
					bCheck = false;
				}
			}
			// delete option
			if(bCheck)
			{
				this.oForm.elements[sSelectNameTo].options[iIdx] = null;
			}
		}
	}
} // eof selectRemoveDefault


/**
 * ceck and submit form data on umt_user_import.cfm
 * 
 * @param  string  sFormAction  the form action (the CFM processing file)
 * @param  string  sMode        the valid and available mode for the CFM processing file
 */
umt.prototype.userImportSubmit = function(sFormAction, sMode)
{
	
	// possible form modes
	aMode    = new Array();
	aMode[0] = "import";
	
	// check form action
	var iCounter = 0;
	for(i=0; i<aMode.length; i++)
	{
		if(aMode[i] == sMode)
		{
			break;
		}
		iCounter += 1;
	}
	if(iCounter == aMode.length)
	{
		this.bProcStat = false;
		this.iErrorId  = 18;
		alert(this.aErrorMsg[this.iErrorId]);
	}
	
	// check data
	if(this.bProcStat)
	{
		// csv file
		sCsvFile = this.oForm.fUmtUserImportCsv.value;
		if(sCsvFile != "" && sCsvFile.length >= 1)
		{
			// check for the file ending "csv"
			iLastIndexOf = this.oForm.fUmtUserImportCsv.value.lastIndexOf(".");
			sFileEnding  = sCsvFile.substring(iLastIndexOf + 1, sCsvFile.length).toLowerCase();
			if(iLastIndexOf < 1 || sFileEnding != "csv")
			{
				this.bProcStat = false;
				this.iErrorId  = 2;
				alert(this.aErrorMsg[this.iErrorId]);
			}
			else
			{
				this.bProcStat = true;
				this.iErrorId  = 0;
			}
		}
		else
		{
			this.bProcStat = false;
			this.iErrorId  = 2;
			alert(this.aErrorMsg[this.iErrorId]);
		}
		
		// start import at (>=1)
		if(this.bProcStat)
		{
			iStartAt = this.oForm.fUmtUserImportStartAt.value;
			if(isNaN(iStartAt))
			{
				this.bProcStat = false;
				this.iErrorId  = 3;
				alert(this.aErrorMsg[this.iErrorId]);
			}
			if(iStartAt < 1)
			{
				this.bProcStat = false;
				this.iErrorId  = 4;
				alert(this.aErrorMsg[this.iErrorId]);
			}
		}
	}
	
	// set hidden form fields
	if(this.bProcStat)
	{
		sUsergroups = "";
		// set mode value
		this.oForm.fUmtUserImportMode.value       = sMode;
		this.oForm.fUmtUserImportUsergroups.value = "";
		// set usergroup id's as a comma separated string (a.e.: 1,3,6)
		for(i=0; i<this.oForm.fUmtUserImportSelectedUG.length; i++)
		{
			sUsergroups += this.oForm.fUmtUserImportSelectedUG.options[i].value + ',';
		}
		if(sUsergroups != "" && sUsergroups.length > 0)
		{
			sUsergroups = sUsergroups.slice(0, sUsergroups.length - 1);
			this.oForm.fUmtUserImportUsergroups.value = sUsergroups;
		}
		// set the original file path into a hidden field for further processing
		this.oForm.fUmtUserImportCsvFilePath.value = this.oForm.fUmtUserImportCsv.value;
	}
	
	// submit form
	if(this.bProcStat)
	{
		// set form action
		this.oForm.action = sFormAction + "?uNC=" + this.randomString() + "&uMode=" + sMode;
		this.oForm.submit();
	}
	
	this.bProcStat = true;
} // eof userImportSubmit


/**
 * check and submit form data on umt_user_add.cfm
 * 
 * @param  string  sFormAction  the form action (the CFM processing file)
 * @param  string  sMode        the valid and available mode for the CFM processing file
 */
umt.prototype.userAddSubmit = function(sFormAction, sMode)
{
	
	aMode    = new Array();
	aMode[0] = "new";
	aMode[1] = "update";
	aMode[2] = "delete";
	
	// form action
	var iCounter = 0;
	for(i=0; i<aMode.length; i++)
	{
		if(aMode[i] == sMode)
		{
			break;
		}
		iCounter += 1;
	}
	if(iCounter == aMode.length)
	{
		this.bProcStat = false;
		this.iErrorId  = 18;
		alert(this.aErrorMsg[this.iErrorId]);
	}
	
	// username
	/*
	if(this.bProcStat)
	{
		if(this.trimString(this.oForm.fUmtUserAddUsername.value) == "")
		{
			this.bProcStat = false;
			this.iErrorId  = 5;
			alert(this.aErrorMsg[this.iErrorId]);
		}
	}
	* */
	
	// password AND retype password
	if(this.bProcStat)
	{
		if(this.trimString(this.oForm.fUmtUserAddPassword.value) != "")
		{
			if(this.trimString(this.oForm.fUmtUserAddPassword.value).length < 6)
			{
				this.bProcStat = false;
				this.iErrorId  = 7;
				alert(this.aErrorMsg[this.iErrorId]);
			}
			else
			{
				// retype password
				if(this.trimString(this.oForm.fUmtUserAddPassword.value) != this.trimString(this.oForm.fUmtUserAddRetypePassword.value))
				{
					this.bProcStat = false;
					this.iErrorId  = 8;
					alert(this.aErrorMsg[this.iErrorId]);
				}
			}
		}
	}
		
	// firstname
	if(this.bProcStat)
	{
		if(this.trimString(this.oForm.fUmtUserAddFirstname.value) == "")
		{
			this.bProcStat = false;
			this.iErrorId  = 9;
			alert(this.aErrorMsg[this.iErrorId]);
		}
	}
	
	// lastname
	if(this.bProcStat)
	{
		if(this.trimString(this.oForm.fUmtUserAddLastname.value) == "")
		{
			this.bProcStat = false;
			this.iErrorId  = 10;
			alert(this.aErrorMsg[this.iErrorId]);
		}
	}
		
	// address1
	/*
	if(this.bProcStat)
	{
		if(this.trimString(this.oForm.fUmtUserAddAddress1.value) == "")
		{
			this.bProcStat = false;
			this.iErrorId  = 11;
			alert(this.aErrorMsg[this.iErrorId]);
		}
	}
	*/
		
	// zip
	/*
	if(this.bProcStat)
	{
		if(this.trimString(this.oForm.fUmtUserAddZip.value) == "")
		{
			this.bProcStat = false;
			this.iErrorId  = 12;
			alert(this.aErrorMsg[this.iErrorId]);
		}
	}
	*/
		
	// city
	/*
	if(this.bProcStat)
	{
		if(this.trimString(this.oForm.fUmtUserAddCity.value) == "")
		{
			this.bProcStat = false;
			this.iErrorId  = 13;
			alert(this.aErrorMsg[this.iErrorId]);
		}
	}
	*/
		
	// country
	/*
	if(this.bProcStat)
	{
		if(this.oForm.fUmtUserAddCountryId.value <= 0)
		{
			this.bProcStat = false;
			this.iErrorId  = 14;
			alert(this.aErrorMsg[this.iErrorId]);
		}
	}
	*/
		
	// e-mail
	if(this.bProcStat)
	{
		if(this.trimString(this.oForm.fUmtUserAddEmail.value) == "")
		{
			this.bProcStat = false;
			this.iErrorId  = 15;
			alert(this.aErrorMsg[this.iErrorId]);
		}
		else
		{
			if(!testEmail(this.trimString(this.oForm.fUmtUserAddEmail.value)))
			{
				this.bProcStat = false;
				this.iErrorId  = 16;
				alert(this.aErrorMsg[this.iErrorId]);
			}
		}
	}
		
	// photosource
	if(this.bProcStat)
	{
		if(this.trimString(this.oForm.fUmtUserAddPhotosource.value) != "")
		{
			// check file ending
			aFileEnding = this.oForm.fUmtUserAddPhotosource.value.split(".");
			sFileEnding = aFileEnding[aFileEnding.length - 1].toLowerCase();
			var iCounter = 0;
			for(i=0; i<this.aImageFormat.length; i++)
			{
				if(this.aImageFormat[i] == sFileEnding)
				{
					break;
				}
				iCounter += 1;
			}
			if(iCounter == this.aImageFormat.length)
			{
				this.bProcStat = false;
				this.iErrorId  = 17;
				alert(this.aErrorMsg[this.iErrorId]);
			}
		}
	}
	
	// set hidden form fields
	if(this.bProcStat)
	{
		// set method action
		this.oForm.fUmtUserAddMode.value = sMode;
		// set the original file path into a hidden field for further processing
		this.oForm.fUmtUserAddFilePath.value = this.oForm.fUmtUserAddPhotosource.value;
	}
	
	// submit form
	if(this.bProcStat)
	{
		this.oForm.action = sFormAction + "?uNC=" + this.randomString() + "&uMode=" + sMode;
		// set form action
		this.oForm.submit();
	}
	
	this.bProcStat = true;
} // eof userAddSubmit







/**
 * check and submit form data on ecrm_groupadd.cfm
 * 
 * @param  string  sFormAction  the form action (the CFM processing file)
 * @param  string  sMode        the valid and available mode for the CFM processing file
 */
umt.prototype.groupAddSubmit = function(sFormAction, sMode)
{
	
	aMode    = new Array();
	aMode[0] = "new";
	aMode[1] = "update";
	aMode[2] = "delete";
	
	// form action
	var iCounter = 0;
	for(i=0; i<aMode.length; i++)
	{
		if(aMode[i] == sMode)
		{
			break;
		}
		iCounter += 1;
	}
	if(iCounter == aMode.length)
	{
		this.bProcStat = false;
		this.iErrorId  = 18;
		alert(this.aErrorMsg[this.iErrorId]);
	}

	// submit form
	if(this.bProcStat)
	{
		//this.oForm.fecrmGroupId.value  = iUserId;
		this.oForm.action = sFormAction + "?uNC=" + this.randomString() + "&uMode=" + sMode;
		// set form action
		this.oForm.submit();
	}
	
	this.bProcStat = true;
} // eof groupAddSubmit



/**
 * alerts a confirmation box with user group name and sets the user group id and the user id into hidden form fields before submitting form.
 * 
 * @param  string   sUsergroupName  the name of the user group which should be deleted for this user
 * @param  integer  iUserId         the user id
 * @param  integer  iUsergroupId    the user group id
 */
umt.prototype.userAddGroupDelGroup = function(sUsergroupName, iUserId, iUsergroupId)
{
	
	if(this.bProcStat)
	{
		// check parameters
		if(iUsergroupId > 0 && iUserId > 0)
		{
			// alert confirmation box
			del = window.confirm("Do you want to remove the user from the user group \"" + sUsergroupName + "\"?");
			// if "yes"
			if(del)
			{
				// set hidden fields
				this.oForm.fUmtUserAddGroupMode.value    = "delete";
				this.oForm.fUmtUserAddGroupUserId.value  = iUserId;
				this.oForm.fUmtUserAddGroupGroupId.value = iUsergroupId;
				// set form action
				this.oForm.action = "umt_useraddgroup.cfm?uNC=" + this.randomString() + "&uMode=delete";
				// submit
				this.oForm.submit();
			}
		}
	}
	
} // eof userAddGroupDelGroup


/**
 * adds a user to a user group, set hidden form fields
 * 
 * @param  string  sFormAction  the form action (the CFM processing file)
 * @param  string  sMode        the valid and available mode for the CFM processing file
 */
umt.prototype.userAddGroupSubmit = function(sFormAction, sMode)
{
	
	// possible form modes
	aMode    = new Array();
	aMode[0] = "new";
	
	// check form action
	var iCounter = 0;
	for(i=0; i<aMode.length; i++)
	{
		if(aMode[i] == sMode)
		{
			break;
		}
		iCounter += 1;
	}
	if(iCounter == aMode.length)
	{
		this.bProcStat = false;
		this.iErrorId  = 18;
		alert(this.aErrorMsg[this.iErrorId]);
	}
	
	// set hidden form fields
	if(this.bProcStat)
	{
		// set method action
		this.oForm.fUmtUserAddGroupMode.value = sMode;
		this.oForm.fUmtUserAddGroupGroupId.value = this.oForm.fGroupId.options[this.oForm.fGroupId.selectedIndex].value;
		this.oForm.fUmtUserAddGroupStatusId.value = this.oForm.fStatusId.options[this.oForm.fStatusId.selectedIndex].value;
	}
	
	// submit form
	if(this.bProcStat)
	{
		// set form action
		this.oForm.action = sFormAction + "?uNC=" + this.randomString() + "&uMode=" + sMode;
		this.oForm.submit();
	}
	
	this.bProcStat = true;
	
} // eof userAddGroupSubmit






/**
 * Edit...
 * 
 * @param  string  sFormAction  the form action (the CFM processing file)
 * @param  string  sMode        the valid and available mode for the CFM processing file
 */
umt.prototype.userEditGroupSubmit = function(sFormAction, sMode)
{
	
	// possible form modes
	aMode    = new Array();
	aMode[0] = "edit";
	
	// check form action
	var iCounter = 0;
	for(i=0; i<aMode.length; i++)
	{
		if(aMode[i] == sMode)
		{
			break;
		}
		iCounter += 1;
	}
	if(iCounter == aMode.length)
	{
		this.bProcStat = false;
		this.iErrorId  = 18;
		alert(this.aErrorMsg[this.iErrorId]);
	}
	
	// set hidden form fields
	if(this.bProcStat)
	{
		// set method action
		this.oForm.fUmtUserAddGroupMode.value = sMode;
		this.oForm.fUmtUserAddGroupGroupId.value = this.oForm.fGroupId.options[this.oForm.fGroupId.selectedIndex].value;
		this.oForm.fUmtUserAddGroupStatusId.value = this.oForm.fStatusId.options[this.oForm.fStatusId.selectedIndex].value;
	}
	
	// submit form
	if(this.bProcStat)
	{
		// set form action
		this.oForm.action = sFormAction + "?uNC=" + this.randomString() + "&uMode=" + sMode;
		this.oForm.submit();
	}
	
	this.bProcStat = true;
	
} // eof userEditGroupSubmit



/**
 * adds a language to a user, set hidden form fields
 * 
 * @param  string  sFormAction  the form action (the CFM processing file)
 * @param  string  sMode        the valid and available mode for the CFM processing file
 */
umt.prototype.userAddLanguageSubmit = function(sFormAction, sMode)
{
	
	// possible form modes
	aMode    = new Array();
	aMode[0] = "new";
	
	// check form action
	var iCounter = 0;
	for(i=0; i<aMode.length; i++)
	{
		if(aMode[i] == sMode)
		{
			break;
		}
		iCounter += 1;
	}
	if(iCounter == aMode.length)
	{
		this.bProcStat = false;
		this.iErrorId  = 18;
		alert(this.aErrorMsg[this.iErrorId]);
	}
	
	// set hidden form fields
	if(this.bProcStat)
	{
		// set method action
		this.oForm.fUmtUserAddLanguageMode.value       = sMode;
		this.oForm.fUmtUserAddLanguageLanguageId.value = this.oForm.fLanguageId.options[this.oForm.fLanguageId.selectedIndex].value;
	}
	
	// submit form
	if(this.bProcStat)
	{
		// set form action
		this.oForm.action = sFormAction + "?uNC=" + this.randomString() + "&uMode=" + sMode;
		this.oForm.submit();
	}
	
	this.bProcStat = true;
	
} // userAddLanguageSubmit


/**
 * removes a language from a user, set hidden form fields
 * 
 * @param  string   sLanguageName  name of the language
 * @param  integer  iUserId        the user id
 * @param  integer  iLanguageId    the language id
 * @param  integer  iOrder         the order id
 */
umt.prototype.userAddLanguageDelLanguage = function(sLanguageName, iUserId, iLanguageId, iOrder)
{
	
	if(this.bProcStat)
	{
		// check parameters
		if(iLanguageId > 0 && iUserId > 0)
		{
			// alert confirmation box
			del = window.confirm("Do you want to remove the language \"" + sLanguageName + "\" from this user?");
			// if "yes"
			if(del)
			{
				// set hidden fields
				this.oForm.fUmtUserAddLanguageMode.value       = "delete";
				this.oForm.fUmtUserAddLanguageUserId.value     = iUserId;
				this.oForm.fUmtUserAddLanguageLanguageId.value = iLanguageId;
				this.oForm.fUmtUserAddLanguageOrderId.value    = iOrder;
				// set form action
				this.oForm.action = "umt_useraddlanguage.cfm?uNC=" + this.randomString() + "&uMode=delete";
				// submit
				this.oForm.submit();
			}
		}
	}
} // eof userAddLanguageDelLanguage


/**
 * starts user data export, set hidden form fields
 * 
 * @param  string  sFormAction  the form action (the CFM processing file)
 * @param  string  sMode        the valid and available mode for the CFM processing file
 */
umt.prototype.userExportSubmit = function(sFormAction, sMode)
{
	
	// check if needed form fields exist
	if(this.oForm.fSelectedOrigin &&
		 this.oForm.fSelectedAS &&
		 this.oForm.fSelectedLang &&
		 this.oForm.fSelectedContries &&
		 this.oForm.fSelectedUG
	)
	{
		
		aMode    = new Array();
		aMode[0] = "export";
			
		// check form action
		var iCounter = 0;
		for(i=0; i<aMode.length; i++)
		{
			if(aMode[i] == sMode)
			{
				break;
			}
			iCounter += 1;
		}
		if(iCounter == aMode.length)
		{
			this.bProcStat = false;
			this.iErrorId  = 18;
			alert(this.aErrorMsg[this.iErrorId]);
		}
		
		if(this.bProcStat)
		{
			// local vars
			sHiddenOrigin    = "";
			sHiddenActivity  = "";
			sHiddenLanguage  = "";
			sHiddenCountry   = "";
			sHiddenUsergroup = "";
			
			// set hidden form fields with selected data
			// origin
			for(i=0; i<this.oForm.fSelectedOrigin.length; i++)
			{
				if(this.oForm.fSelectedOrigin.options[i].value > 0)
				{
					sHiddenOrigin += this.oForm.fSelectedOrigin.options[i].value + ',';
				}
			}
			if(this.trimString(sHiddenOrigin) != "" && this.trimString(sHiddenOrigin).length > 0)
			{
				sHiddenOrigin = sHiddenOrigin.slice(0, sHiddenOrigin.length - 1);
				this.oForm.fUmtUserExportOrigin.value = sHiddenOrigin;
			}
			
			// activitystatus
			for(i=0; i<this.oForm.fSelectedAS.length; i++)
			{
				if(this.oForm.fSelectedAS.options[i].value > 0)
				{
					sHiddenActivity += this.oForm.fSelectedAS.options[i].value + ',';
				}
			}
			if(this.trimString(sHiddenActivity) != "" && this.trimString(sHiddenActivity).length > 0)
			{
				sHiddenActivity = sHiddenActivity.slice(0, sHiddenActivity.length - 1);
				this.oForm.fUmtUserExportActivitystatus.value = sHiddenActivity;
			}
			
			// language
			for(i=0; i<this.oForm.fSelectedLang.length; i++)
			{
				if(this.oForm.fSelectedLang.options[i].value > 0)
				{
					sHiddenLanguage += this.oForm.fSelectedLang.options[i].value + ',';
				}
			}
			if(this.trimString(sHiddenLanguage) != "" && this.trimString(sHiddenLanguage).length > 0)
			{
				sHiddenLanguage = sHiddenLanguage.slice(0, sHiddenLanguage.length - 1);
				this.oForm.fUmtUserExportLanguage.value = sHiddenLanguage;
			}
			
			// country
			for(i=0; i<this.oForm.fSelectedContries.length; i++)
			{
				if(this.oForm.fSelectedContries.options[i].value > 0)
				{
					sHiddenCountry += this.oForm.fSelectedContries.options[i].value + ',';
				}
			}
			if(this.trimString(sHiddenCountry) != "" && this.trimString(sHiddenCountry).length > 0)
			{
				sHiddenCountry = sHiddenCountry.slice(0, sHiddenCountry.length - 1);
				this.oForm.fUmtUserExportCountry.value = sHiddenCountry;
			}
			
			// user groups
			for(i=0; i<this.oForm.fSelectedUG.length; i++)
			{
				if(this.oForm.fSelectedUG.options[i].value > 0)
				{
					sHiddenUsergroup += this.oForm.fSelectedUG.options[i].value + ',';
				}
			}
			if(this.trimString(sHiddenUsergroup) != "" && this.trimString(sHiddenUsergroup).length > 0)
			{
				sHiddenUsergroup = sHiddenUsergroup.slice(0, sHiddenUsergroup.length - 1);
				this.oForm.fUmtUserExportUsergroup.value = sHiddenUsergroup;
			}
			
			// submit form
			if(this.bProcStat)
			{
				// set mode value
				this.oForm.fUmtUserExportMode.value = sMode;
				// set form action
				this.oForm.action = sFormAction + "?uNC=" + this.randomString() + "&uMode=" + sMode;
				this.oForm.submit();
			}
			
			this.bProcStat = true;
		}
	} // eof check if needed form fields exist

}


/** *****************************************************************************************************************************************/


/**
 * check and submit form data on ecrm_campaignadd.cfm
 * 
 * @param  string  sFormAction  the form action (the CFM processing file)
 * @param  string  sMode        the valid and available mode for the CFM processing file
 */
umt.prototype.campaignAddSubmit = function(sFormAction, sMode)
{
	
	aMode    = new Array();
	aMode[0] = "new"; 
	aMode[1] = "update";
	aMode[2] = "delete";
	
	// form action
	var iCounter = 0;
	for(i=0; i<aMode.length; i++)
	{
		if(aMode[i] == sMode)
		{
			break;
		}
		iCounter += 1;
	}
	if(iCounter == aMode.length)
	{
		this.bProcStat = false;
		this.iErrorId  = 18;
		alert(this.aErrorMsg[this.iErrorId]);
	}

	// submit form
	if(this.bProcStat)
	{
		//this.oForm.fecrmGroupId.value  = iUserId;
		this.oForm.action = sFormAction + "?uNC=" + this.randomString() + "&uMode=" + sMode;
		// set form action
		this.oForm.submit();
	}
	
	this.bProcStat = true;
} // eof campaignAddSubmit 



/**
 * check and submit form data on ecrm_activitiesadd.cfm
 * 
 * @param  string  sFormAction  the form action (the CFM processing file)
 * @param  string  sMode        the valid and available mode for the CFM processing file
 */
umt.prototype.activitiesAddSubmit = function(sFormAction, sMode)
{
	
	aMode    = new Array();
	aMode[0] = "new"; 
	aMode[1] = "update";
	aMode[2] = "delete";
	
	// form action
	var iCounter = 0;
	for(i=0; i<aMode.length; i++)
	{
		if(aMode[i] == sMode)
		{
			break;
		}
		iCounter += 1;
	}
	if(iCounter == aMode.length)
	{
		this.bProcStat = false;
		this.iErrorId  = 18;
		alert(this.aErrorMsg[this.iErrorId]);
	}

	// submit form
	if(this.bProcStat)
	{
		//this.oForm.fecrmGroupId.value  = iUserId;
		this.oForm.action = sFormAction + "?uNC=" + this.randomString() + "&uMode=" + sMode;
		// set form action
		this.oForm.submit();
	}
	
	this.bProcStat = true;
} // eof activitiesAddSubmit



//--------------------------------------------------
function testString(f_sString)
{
	if (f_sString.length > 0)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testStringEq(f_sString, f_iLen)
{
	if (f_sString.length == f_iLen)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testStringGt(f_sString, f_iLen)
{
	if (f_sString.length > f_iLen)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testStringLt(f_sString, f_iLen)
{
	if (f_sString.length < f_iLen)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testInt(f_iInteger)
{
	var regInt = /^[0-9]+$/;
	
	if (regInt.test(f_iInteger) == true)
	{
		return true;
	}	
	else
	{
		return false;
	}
}

function testFloat(f_flFloat)
{
	var regFloat = /^[0-9]+(\.[0-9]+)*$/;
	
	if (regFloat.test(f_flFloat) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testIntGtZero(f_iInteger)
{
	var regInt = /^[0-9]+$/;
	
	if (regInt.test(f_iInteger) == true && f_iInteger > 0)
	{
		return true;
	}	
	else
	{
		return false;
	}
}

function testMinusOne(f_iInteger)
{
	if (f_iInteger != -1)
	{
		return true;
	}	
	else
	{
		return false;
	}
}

function testTime(f_sTime)
{
	var regTime = /^([0-2]?[0-9]):[0-5][0-9](:[0-5][0-9])?$/;
	var iIndex;
	var iValue;
	var sValue = f_sTime;
	
	if (regTime.test(sValue) == true)
	{
		iIndex = sValue.indexOf(":");
		iValue = sValue.substr(0,iIndex);
		
		if (iValue <= 23 && iValue >=0)
		{
			return true;
		}
		else
		{
			return false;
		}	
	}
	else
	{
		return false;
	}
}

function testDate(f_sDate)
{
	var regDate = /^([0-3]?[0-9])\.([0-1]?[0-9])\.[1-9][0-9]{3}$/;
	var iIndex, iIndex2;
	var iMonth,iDay,iYear;
	var arrMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	var sValue = f_sDate;
	
	if (regDate.test(sValue) == true)
	{
		iIndex = sValue.indexOf(".");
		iIndex2 = sValue.indexOf(".",iIndex+1);
		
		iDay = sValue.substr(0,iIndex);
		iMonth = sValue.substring(iIndex+1,iIndex2);
		iYear = sValue.substr(iIndex2+1,sValue.length);		

		if (iMonth < 1 || iMonth > 12)
		{
			return false;		
		}
		
		if (iMonth == 2 && ( ( (iYear % 4) == 0 && (iYear % 100) != 0 ) || (iYear % 400) == 0 ) ) 
		{
			if (iDay < 1 || iDay > 29)
			{
				return false;
			}
		}
		else
		{
			if (iDay < 1 || iDay > arrMonth[iMonth-1])
			{
				return false;
			}
		}		

		return true;

	}
	else
	{
		return false;
	}
}

function compareDate(f_sDate1,f_sDate2)
{
	var sValue1 = f_sDate1;
	var sValue2 = f_sDate2;
	
	iIndex = sValue1.indexOf(".");
	iIndex2 = sValue1.indexOf(".",iIndex+1);
	
	iDay1 = sValue1.substr(0,iIndex);
	iDay1 = (iDay1.length == 2) ? iDay1 : iDay1 = "0" + iDay1 ; 
	iMonth1 = sValue1.substring(iIndex+1,iIndex2);
	iMonth1 = (iMonth1.length == 2) ? iMonth1 : iMonth1 = "0" + iMonth1 ; 
	iYear1 = sValue1.substr(iIndex2+1,sValue1.length);	

	
	iIndex = sValue2.indexOf(".");
	iIndex2 = sValue2.indexOf(".",iIndex+1);
	
	iDay2 = sValue2.substr(0,iIndex);
	iDay2 = (iDay2.length == 2) ? iDay2 : iDay2 = "0" + iDay2 ; 
	iMonth2 = sValue2.substring(iIndex+1,iIndex2);
	iMonth2 = (iMonth2.length == 2) ? iMonth2: iMonth2 = "0" + iMonth2 ; 
	iYear2 = sValue2.substr(iIndex2+1,sValue2.length);		
	
	iDate1 = parseInt(iYear1 + iMonth1 + iDay1);
	iDate2 = parseInt(iYear2 + iMonth2 + iDay2);
	
	if(iDate1 <= iDate2)
	{
		return true
	}
	else
	{
		return false;
	}
}

function testEmail(f_sEmail)
{
	var regEmail = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*\.([a-zA-Z]{2,4})$/;
	
	if (regEmail.test(f_sEmail) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testChPlz(f_iPLZ)
{
	var regPLZ = /^[1-9][0-9]{3}$/;
	
	if (regPLZ.test(f_iPLZ) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testCHMoney(f_flMoney)
{
	var regMoney = /(^[1-9][0-9]*|^0)(\.[0-9](0|5))?$/;
	
	if (regMoney.test(f_flMoney) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testEmpty(f_sString)
{
	var regWhiteSpace = /[^ \f\n\r\t]/;
	
	if (regWhiteSpace.test(f_sString))
	{
		return false;
	}
	else
	{
		return true;
	}
}

function testReg(f_sString,f_regString)
{

	regString = new RegExp(f_regString,"gi");
	if (regString.test(f_sString) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

//--------------------------------------------------
