﻿$(document).ready(function () {
    $.ajax({
        url: KelloggsServiceURL + '/bin/ccquerybuilder.jsonp?propertyName=sitepath&propertyValue=http://' + location.host + "/",
        dataType: 'jsonp',
        success: function (data) {

        },
        error: function (data) {

        }
    });
});

function getAlert(jsonObject) {
    var json = JSON.parse(jsonObject);
    var i;
    var msg = "";
    for (i = 0; i < json.hits.length; i++) {
        // check this condition				
        var ser = json.hits[i].detMsgURL;
        // check the URL whether its a day based application or non-day based application     	
        var alertImgURL = json.hits[i].alertImgURL;
        var destURL = json.hits[i].detMsgURL;
        var shortMsg = json.hits[i].shortMsg;
        msg += '<div class="errorwrap"><p><img style="vertical-align:middle;margin-top:0px" src="' + alertImgURL + '" height="20" width="20" alt="Alert Image" />&nbsp;<a class="error_msg" href=\'' + destURL + '\' target=\'_blank\'> ' + shortMsg + '</a></div>';
    }

    if (document.getElementById('error_wp').innerHTML != null)
        document.getElementById('error_wp').innerHTML = msg;
}


var xhr = null;
function httpReq() {
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xhr = new XMLHttpRequest();
    }
    else {
        // code for IE6, IE5
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }
}
