// JavaScript Document

<!--
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function inHtml_DoFSCommand(command, args) {
	var inHtmlObj = isInternetExplorer ? document.all.inHtml : document.inHtml;
	//
	if (command == 'send_inHtml'){
		setInHtml('contentid',args);
	} else if (command == 'send_Hresize'){
		setFlashHeight('flashid', args)
	} else if (command == 'ajaxMain'){
		get_Ajax(args,'','contentid')
	}
	//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub inHtml_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call inHtml_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
//-->

function setInHtml(htmlid,args){
	//alert ("write");
	document.getElementById(htmlid).innerHTML = args;
}

function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}
function setflashheight(divid, newH){
	//alert(newH);
	document.getElementById(divid).style.height = newH+"px";		
}
function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}


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"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject();
var objid = new String();

/* Function called to get the product categories list */
function getRequest(url,value, to_id){
	
    objid.value = to_id;
	http.open('get', url+ value);
	/* Define a function to call once a response has been received. This will be our
		handleProductCategories function that we define below. */
	http.onreadystatechange = handleProducts;
	/* Send the data. We use something other than null when we are sending using the POST
		method. */
		//alert (handleProducts);
	http.send(null);
}

/* Function called to handle the list that was returned from the internal_request.php file.. */
function handleProducts(){
	
	if(http.readyState == 4){ //Finished loading the response
            response = new String();
		response = http.responseText;
		
		document.getElementById(objid.value).innerHTML = response;
	}
}

function get_Ajax(url,value,att){
    getRequest(url,value,att);	
}


