/* The following function creates an XMLHttpRequest object... */
/* Note: Dont delete any commented codes and dont change nothing*/
//var site_url='oreficejewels.com';
var tmr;

function createRequestObject(){
	var request_o; //declare the variable to hold the object.
/*	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
	
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		
		request_o = new XMLHttpRequest();
	}*/
	 //return the object
	try {  request_o = new ActiveXObject('Msxml2.XMLHTTP');   }
    catch (e) 
    {
        try {   request_o = new ActiveXObject('Microsoft.XMLHTTP');    }
        catch (e2) 
        {
          try {  request_o = new XMLHttpRequest();     }
          catch (e3) {  request_o = false;   }
        }
     }
return request_o;
}

divs= new Array();
var d_div='d4';
/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject();
function microchat()
	{
	tmr=setInterval("updatechat()", 5000);	
	}
//////////////////////////
//site ajax content

//////////////////////////
function addtochat(chsubgect){
	ch=chsubgect;
	addmessage(ch);
return false;
}
function addmessage(chsubgect){
	var poststr ="posparams="+escape("chsubgect=" + encodeURI( chsubgect ));

	http.open('post', 'ajax.php?mod=shoutbox&function=addtochat');
	http.onreadystatechange = handleaddtochat;
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  //    http.setRequestHeader("Content-length", poststr.length);
 //     http.setRequestHeader("Connection", "close");

	http.send(poststr);
	return false;
}
function handleaddtochat(){
	if(http.readyState == 4){
		var response = http.responseText;
		//refresh_cart();
	//	if (uc){
	//		var P_IDs='';
	//		var P_IDs=new Array();
		updatechat();
		return false;
		}
		//else refresh_cart();
	//}
}
function updatechat(){
	http.open('get', 'ajax.php?mod=shoutbox&function=updatechat');
	http.onreadystatechange = handleupdatechat;
	http.send(null);
}
function handleupdatechat(){
	if(http.readyState == 4){
		
		var response = http.responseText;
		
		document.getElementById("microchat").innerHTML = response;
		return false;
	}
}
function currency(){
	http.open('get', 'currency.php');
	http.onreadystatechange = handlecurrencyt;
	http.send(null);
}
function handlecurrencyt(){
	if(http.readyState == 4){
		
		var response = http.responseText;
		
		document.getElementById("cur").innerHTML = response;
		return false;
	}
}
