function setTimezone1(aUrl, aTimezone) {
	try {
		sSoap = "<?xml version=\"1.0\" encoding=\"utf-8\"?> <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><TimeZone xmlns=\"LKWebSvcs\"><aTimeZone>" + aTimezone + "</aTimeZone></TimeZone></soap:Body></soap:Envelope>";				
		sendObj(aUrl, sSoap, "LKWebSvcs/TimeZone");				
	} 
	catch (e) {}
}

function setTimezone(aUrl) {
    var dt = new Date();
    var dti = dt.getTimezoneOffset() + " " + (dt.getMonth() +1) + "/" + dt.getDate() + "/" + dt.getFullYear() + "::" + dt.getHours() + ":" + dt.getMinutes() + ":" + dt.getSeconds() + ":" + dt.getMilliseconds();
    jQuery.ajax({
        type : 'GET',        
        url : aUrl + '/TimeZone',
        dataType : 'xml',
        data: {
            aTimeZone : dti
        },
        success : function(data) {
            //alert('success: ' + data);
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            //alert('error: ' + data);
        }
    });
}

/** Encapsulation functions to Create and Send Objects. **/
function createObj()
{
	oXmlHttp = false;
	try {		
		return window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")					
	}
	catch (e) {}
	return oXmlHttp;
}
function sendObj(aUrl, aSoap, aSOAPAction) {
	try {
		oXmlHttp = createObj();		
		oXmlHttp.open("POST", aUrl, false);				    		
		oXmlHttp.setRequestHeader("Content-Type", "text/xml");				    
		//oXmlHttp.setRequestHeader("SOAPAction", "http://LuckyKabutar.com/" + aSOAPAction);	
		oXmlHttp.setRequestHeader("SOAPAction", aSOAPAction);	
		oXmlHttp.send(aSoap);				 	
	}
	catch (e) {}
}
function sendObjWithReturn(aUrl, aSoap, aSOAPAction) {
	try {
		oXmlHttp = createObj();	
		var sReturn = "";
		oXmlHttp.open("POST", aUrl, false);				    		
		oXmlHttp.setRequestHeader("Content-Type", "text/xml");				    
		oXmlHttp.setRequestHeader("SOAPAction", "http://LuckyKabutar.com/" + aSOAPAction);	
		oXmlHttp.send(aSoap);	
		if (oXmlHttp.readyState == 4)
		{
			sReturn = ((oXmlHttp.status == 200)?oXmlHttp.responseXML.selectSingleNode("//" + aSOAPAction + "Result"):sReturn);
			if ((sReturn != null) || (sReturn.trim() != "")) {				
				stripWhiteSpace(sReturn);
			}
		}
	}
	catch (e) {}
	return sReturn;
}

// AJAXLib v. 1.0
// author: Jacek Karaszewski, http://www.karaszewski.com/tools/ajaxlib/
// licenced under Creative Commons Attribution 2.5 License
function findWhiteSpace(node, nodeNo) {
	for (i=0; i<node.childNodes.length; i++) {
		if (node.childNodes[i].nodeType == 3 && is_ws(node.childNodes[i])) {
			nodesToDelete[nodesToDelete.length] = node.childNodes[i]
		}
		if (node.childNodes[i].hasChildNodes()) {
			findWhiteSpace(node.childNodes[i], i);
		}
	}
	node = node.parentNode;
	i = nodeNo;
}

function stripWhiteSpace(node) {
	nodesToDelete = Array();
	findWhiteSpace(node, 0);
	for(i=nodesToDelete.length-1;i>=0;i--) {
		nodeRef = nodesToDelete[i];
		nodeRef.parentNode.removeChild(nodeRef)
	}
}

function is_ws(nod) {
	return !(/[^\t\n\r ]/.test(nod.data));
}


