//
// !COPYRIGHT!
//                      Copyright (c) 2007 Teleformix LLC
//                       All Rights Reserved
// 
// 
// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF TELEFORMIX LLC
// 
// The copyright notice above does not evidence any
// actual or intended publication of such source code.
// 
// This document contains trade secret data and proprietary information of
// Teleformix, LLC and should be treated as confidential.  No part of this 
// information may be copied, or disclosed in part or in whole as permitted 
// by Teleformix LLC
// 
// Copyright (c) 1998-2007 by Teleformix, LLC.
// All Rights Reserved
// 
// $Id: standalone.js,v 1.6 2008/01/11 22:08:58 pdiverde Exp $
// !!
//


var daoObject ;
var retval ;

function initialize()
{
	daoClient = new AjaxAccess();
	daoClient.initialize(AJAX_CONTROLLER, SERVICE_MANAGER, AGENT_SERVER);
}

function cleanup()
{
	daoClient.cleanup();
}

function countURLParam(URL)
{
	var count = 0 ;
	var qs ;

	if(URL.indexOf("?") > -1)
	{
		qs = URL.substr(URL.indexOf("?")) ;
		count = qs.length ;
	}

	return count ;
}

function getURLParam(strParamName)
{
	var strReturn = "";
	var strHref = document.location.search;

	if ( strHref.indexOf("?") > -1 )
	{
		var strQueryString = strHref.substr(strHref.indexOf("?")) ;
		var aQueryString = strQueryString.split("&");
		for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
		{
			if ( aQueryString[iParam].indexOf(strParamName + "=") > -1 )
			{
				var aParam = aQueryString[iParam].split("=");
				strReturn = aParam[1];
				break;
			}
		}
	}

	return trim(unescape(strReturn));
}

//
// COMPAT
//
function isIE()
{
	return window.navigator.userAgent.indexOf("MSIE") > 0;
}


function nap(m)
{
	var then  ;

	m = m * 1000 ;

	then = new Date(new Date().getTime() + m);

	while (new Date() < then)
	{
		;
	}
}
