

  // Funny text script by Bart Jellema -->

/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  	xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  	try {
    		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  	} catch (e2) {
    		xmlHttp = false;
  	}
}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != "undefined") {
  xmlHttp = new XMLHttpRequest();
}

function showmain(title,content){
        showmaincontent(title,content);
	}

function showmaincontent(title,content){ 

var url = "includes/"+content+".asp?idcontent="+title;
  	xmlHttp.open("GET", url, true);
	document.getElementById('content').innerHTML="<p class='subMenu'>Loading...</p>";
  	xmlHttp.onreadystatechange = updateArticle;
  	xmlHttp.send(null);
}

function updateArticle() {
  	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
			var responsetext="<div id='content'>"+xmlHttp.responseText+"</div>";
                document.getElementById('main_main').innerHTML=responsetext;
            } else {
                alert('There was a problem with the request.');
            }
  	}
}


function flushcart(){ 
var url = "../includes/login.asp?action=flush";
 	xmlHttp.open("GET", url, true);
 	xmlHttp.onreadystatechange = updateflushcart;
 	xmlHttp.send(null);
}

function updateflushcart() {
  	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
			    opener.document.getElementById('sign').innerHTML=xmlHttp.responseText;
            } else {
                alert('There was a problem with the request.');
            }
  	}
}

function usercenter(title){ 

var url = "includes/server.asp?action="+title;
  	xmlHttp.open("GET", url, true);
	document.getElementById('content').innerHTML="<p class='subMenu'>Loading...</p>";
  	xmlHttp.onreadystatechange = updateusercenter;
  	xmlHttp.send(null);
}

function updateusercenter() {
  	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
                document.getElementById('content').innerHTML=xmlHttp.responseText;
            } else {
                alert('There was a problem with the request.');
            }
  	}
}

function orderdel(title){ 

var url = "includes/orderexp.asp?action="+title;
  	xmlHttp.open("GET", url, true);
	//window.opener.document.getElementById('orderlist').innerHTML="<p class='subMenu'>Loading...</p>";
  	xmlHttp.onreadystatechange = updateorderdel;
  	xmlHttp.send(null);
}

function updateorderdel() {
  	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
			//alert(xmlHttp.responseText);
                window.opener.document.getElementById('orderlist').innerHTML=xmlHttp.responseText;
            } else {
                alert('There was a problem with the request.');
            }
  	}
}

function showaddproduct(id){ 
var url = "addproduct.asp?id="+id+"";
//alert(url);
  	xmlHttp.open("GET", url, true);
	//document.getElementById('test').innerHTML="<p class='subMenu'>Loading...</p>";
  	xmlHttp.onreadystatechange = updateaddproduct;
  	xmlHttp.send(null);
}

function updateaddproduct() {
  	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
			var responsetext="<div id='test'>"+xmlHttp.responseText+"</div>";
                //document.getElementById('test').innerHTML=responsetext;
            } else {
                alert('There was a problem with the request.');
            }
  	}
}


function shopopen(id){
	window.open('order/shop.asp?ProdId='+id,'blank_','scrollbars=yes,resizable=no,width=650,height=450,left=150')
	}
function favopen(id){
	window.open('order/fav.asp?ProdId='+id,'blank_','scrollbars=yes,resizable=no,width=650,height=450,left=150')
	}
function image(id,name){
window.open('image.asp?id='+id+'&name='+name,'blank_','scrollbars=yes,resizable=yes,width=1,height=1,left=150');
	}

