// JavaScript Document

var http = createRequestObject(); 



var now = new Date();

var hour        = now.getHours();

var minute      = now.getMinutes();

var second      = now.getSeconds();

var monthnumber = now.getMonth();

var monthday    = now.getDate();

var year        = now.getYear();


var zips="";

function show_Subcat(category_id,State_id){
//alert(State_id);
	http.open('get', 'chkship.asp?shipcity='+category_id+'&shipstate='+State_id+'&unique='+now+hour+minute+second);
	http.onreadystatechange =  get_subcat_details; 
	http.send(null);
}
function get_subcat_details(){
	if(http.readyState == 4){ 
	   var response = http.responseText;
 	   document.getElementById("Show_sub_cat").innerHTML = response;
	}
}


function show_city(State_id){
//alert(State_id)
	http.open('get', 'getstate.asp?State_id='+State_id+'&unique='+now+hour+minute+second);
	http.onreadystatechange =  get_state_details; 
	http.send(null);
}
function get_state_details(){
	if(http.readyState == 4){ 
	   var response = http.responseText;
 	   document.getElementById("ShowCity").innerHTML = response;
	}
}



function show_sub(Main_Cat){
//alert(Main_Cat);
 document.getElementById("ShowSubCat").innerHTML = '';
  document.getElementById("ShowSubSubCat").innerHTML = '';

	http.open('get', 'getSubCat.asp?main_cat_id='+Main_Cat+'&unique='+now+hour+minute+second);
	http.onreadystatechange =  get_sub_details; 
	http.send(null);
}
function get_sub_details(){
	if(http.readyState == 4){ 
	   var response = http.responseText;
 	   document.getElementById("ShowSubCat").innerHTML = response;
	}
}




function show_sub_sub(Sub_Cat){
//alert(Main_Cat);
	http.open('get', 'getSubSubCat.asp?Sub_Cat='+Sub_Cat+'&unique='+now+hour+minute+second);
	http.onreadystatechange =  get_sub_sub_details; 
	http.send(null);
}
function get_sub_sub_details(){
	if(http.readyState == 4){ 
	   var response = http.responseText;
 	   document.getElementById("ShowSubSubCat").innerHTML = response;
	}
}





function show_citydetails(State_id){
//alert(State_id)
	http.open('get', 'getcity.asp?State_id='+State_id+'&unique='+now+hour+minute+second);
	http.onreadystatechange =  get_city_details; 
	http.send(null);
}
function get_city_details(){
	if(http.readyState == 4){ 
	   var response = http.responseText;
 	   document.getElementById("ShowCityDetails").innerHTML = response;
	}
}

function show_citydetails2(State_id){
//alert(State_id)
	http.open('get', 'getcity1.asp?State_id='+State_id+'&unique='+now+hour+minute+second);
	http.onreadystatechange =  get_city_details1; 
	http.send(null);
}
function get_city_details1(){
	if(http.readyState == 4){ 
	   var response = http.responseText;
 	   document.getElementById("ShowCityDetails1").innerHTML = response;
	}
}



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 request_o; //return the object

}