// copyright 2001-2009 DTLink, L.L.C. all rights reserved.
// http://www.formvista.com
//
// for use in event chains.

if ( typeof( fv_loadUrl ) == 'undefined' )
	{

function fv_loadUrl( parms )
{

var elem = parms.elem;
var href = parms.href;

if (( typeof( $(elem).data( "_fv_payload" ) ) != 'undefined' ) && ( ! jQuery.isEmptyObject( $(elem).data( "_fv_payload" ) ) ))
	{
	var payload = $(elem).data( "_fv_payload" );

	// now replace any $[] references in the content with their
	// corresponding values.

	$.each( payload, function(i, val)
		{ 

		exp = "\\$\\[" + i + "\\]";

		href = href.replace( new RegExp( exp, "g" ), val );

		} );

	// remove any template variables left over.

	exp = "\\$\\[.*?\\]";
	href = href.replace( new RegExp( exp, "g" ), "" );

	}

window.location.href = href;

// I do not understand why but under MSIE 6 if you return true here
// the page does not load. 

return false;

}

	}

