﻿// JScript File

function newHttpRequest(url,bAsync)
{		
	var xmlhttp = getXMLHttpObj();
	if( xmlhttp==null ) return null;
	xmlhttp.open('GET',url,bAsync);
	xmlhttp.setRequestHeader("Cache-Control", "no-cache");
	return xmlhttp;
}
function getXMLHttpObj()// Get the XMLHttpRequest object
{
	if(window.widget) return new XMLHttpRequest(); // for nokia widget

    var xmlhttp=null;
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
		try {
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
          xmlhttp = null;
        }
    }
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  	  try {
		xmlhttp = new XMLHttpRequest();
	  } catch (e) {
        xmlhttp=null;
	  }
	}
	return xmlhttp;
}
function createCookie(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var expires = "; expires=" + date.toGMTString();
    }
    else var expires = "";
    document.cookie = name + "=" + value + expires + "; path=/";
}
function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
}


