var __iw_jax = new Jax();
var __iw_current_page = window.location.href;
var __iw_referrer = escape(document.referrer);

createJax();
ui_page();
function ui_inputChange(fieldId,c)
{
    try
    {
    if (!c) return;
    if (!__iw_jax) return;
    var id = parseInt(fieldId);
    if (isNaN(id)) return;
    
    if (c.tagName == 'INPUT')
    {
        var type = c.getAttribute('type');
        if (type == 'radio')
            __iw_jax.OnFieldChange(id,c.id,c.checked,window.location.href, function(response) {});
        else if (type == 'checkbox')
            __iw_jax.OnFieldChange(id,c.id,c.checked,window.location.href, function(response) {});
        else if (type == 'button')
            __iw_jax.OnFieldChange(id,c.id,c.value,window.location.href, function(response) {});
        else if (type == 'image')
            __iw_jax.OnFieldChange(id,c.id,type,window.location.href, function(response) {});
        else if (type == 'reset')
            __iw_jax.OnFieldChange(id,c.id,type,window.location.href, function(response) {});
        else if (type == 'submit')
            __iw_jax.OnFieldChange(id,c.id,type,window.location.href, function(response) {});
        else
            __iw_jax.OnFieldChange(id,c.id,c.value,window.location.href, function(response) {});
    }
    else
    {
        __iw_jax.OnFieldChange(id,c.id,c.value,window.location.href, function(response) {});
    }
    }
    catch(e) {}
}
function ui_field(fieldId,fieldLabel,fieldValue,pageName)
{
    try{
    if (!__iw_jax) return;
    if (isNaN(parseInt(fieldId))) return;
    
    if (fieldLabel == null || fieldLabel == undefined)
      fieldLabel = '';
    if (fieldValue == null || fieldValue == undefined)
      fieldValue = '';
    if (pageName == null || pageName == undefined)
      pageName = window.location.href;
      
    __iw_jax.OnFieldChange(parseInt(fieldId),fieldLabel,fieldValue,pageName, function(response) {});
    }
    catch(e) {}
}
function ui_page()
{
    try
    {
    __iw_jax.OnPageVisit(__iw_current_page, __iw_referrer, function(response) {});
    }
    catch(e) {}
}
function ui_event(eventId)
{
    try
    {
    var args = new Array();
    if (arguments.length > 1)
    {
        for (var i=1;i<arguments.length;i++)
            args[i-1] = arguments[i];
        __iw_jax.OnSiteEventOccur(__iw_current_page, __iw_referrer, eventId, args,function(response) {});
    }
    else
    {
        __iw_jax.OnSiteEventOccur(__iw_current_page, __iw_referrer, eventId,function(response) {});
    }
    }
    catch(e) {}
    
}
function createJax()
{
	__iw_jax = new Jax("http://www.insweb.com/insweb.web.tracking/Jax.ashx");
    
}