var ajaxDrop = new sackDrop();

//Code for create Model List
function getModelList(sel, siteURL)
 {
	var siteURL;
	var selMadeId   = document.getElementById('selMade').value;
	document.getElementById('selModel').options.length = 0;	// Empty models select box
	document.getElementById('selYear').options.length = 0;	// Empty year select box	
	
	if(selMadeId.length>0){
		ajaxDrop.requestFile  = siteURL+'/js/ajax_getModelList.php?madeid='+selMadeId;	// Specifying which file to get
		ajaxDrop.onCompletion = createModels;	// Specify function that will be executed after file has been found
		ajaxDrop.runAJAX();		// Execute AJAX function
	}
 }

function createModels()
 {
	var obj = document.getElementById('selModel');
	eval(ajaxDrop.response);	// Executing the response from Ajax as Javascript code	
 }

//Code for create Model Year List
function getModelYearList(sel, siteURL)
 {
	var siteURL;
	var selType   = document.getElementById('selType').value;
	var selModel  = document.getElementById('selModel').value;
	var selMake   = document.getElementById('selMade').value;
   	document.getElementById('selYear').options.length = 0;	// Empty competition select box
	/////if(selType.length>0){
		/////ajaxDrop.requestFile  = siteURL+'js/ajax_getYearlList.php?typeNm='+selType;	// Specifying which file to get
		ajaxDrop.requestFile  = siteURL+'js/ajax_getYearlList.php?typeNm='+selType+'&modelNm='+selModel+'&madeNm='+selMake;	// Specifying which file to get
		ajaxDrop.onCompletion = createYear;	// Specify function that will be executed after file has been found
		ajaxDrop.runAJAX();		// Execute AJAX function
	/////}
 }
 
 function createYear()
 {
	var obj = document.getElementById('selYear');
	eval(ajaxDrop.response);	// Executing the response from Ajax as Javascript code	
 }
 
 function getModelTypeList(sel, siteURL)
 {
	var siteURL;
	var selModelId   = document.getElementById('selModel').value;
	document.getElementById('selType').options.length = 0;	
	
	if(selModelId.length>0){
		ajaxDrop.requestFile  = siteURL+'/js/ajax_getTypeList.php?modelid='+selModelId;	// Specifying which file to get
		ajaxDrop.onCompletion = createType;	// Specify function that will be executed after file has been found
		ajaxDrop.runAJAX();		// Execute AJAX function
	}
 }

 function createType()
 {
	var obj = document.getElementById('selType');
	eval(ajaxDrop.response);	// Executing the response from Ajax as Javascript code	
 }

//Code for create Area List
function getAreaList(sel, siteURL)
 {
	var siteURL;
	var selCountryId   = document.getElementById('selCountry').value;
	document.getElementById('selArea').options.length = 0;	// Empty competition select box
	
	if(selCountryId.length>0){
		ajaxDrop.requestFile  = siteURL+'/js/ajax_getAreaList.php?countryid='+selCountryId;	// Specifying which file to get
		ajaxDrop.onCompletion = createAreas;	// Specify function that will be executed after file has been found
		ajaxDrop.runAJAX();		// Execute AJAX function
	}
 }

function createAreas()
 {
	var obj = document.getElementById('selArea');
	eval(ajaxDrop.response);	// Executing the response from Ajax as Javascript code	
 }
 
 
 //Code for create Area List
function getBillingAreaList(sel, siteURL)
 {
	var siteURL;
	var selCountryId   = document.getElementById('selCountry_B').value;
	document.getElementById('selArea_B').options.length = 0;	// Empty competition select box
	
	if(selCountryId.length>0){
		ajaxDrop.requestFile  = siteURL+'/js/ajax_getAreaList.php?countryid='+selCountryId;	// Specifying which file to get
		ajaxDrop.onCompletion = createBillingAreas;	// Specify function that will be executed after file has been found
		ajaxDrop.runAJAX();		// Execute AJAX function
	}
 }

function createBillingAreas()
 {
	var obj = document.getElementById('selArea_B');
	eval(ajaxDrop.response);	// Executing the response from Ajax as Javascript code	
 }
 
 
 
 //Code for create Area List
function getShoppingCart(oId, siteURL)
 {
	var siteURL;
	var fldOrderID   = oId;
	
	ajaxDrop.requestFile  = siteURL+'/js/ajax_getShoppingDetails.php?oid='+fldOrderID;	// Specifying which file to get
	ajaxDrop.onCompletion = createShoppingCart;	// Specify function that will be executed after file has been found
	ajaxDrop.runAJAX();		// Execute AJAX function

 }

function createShoppingCart()
 {
	var obj = document.getElementById('div1');
	eval(ajaxDrop.response);	// Executing the response from Ajax as Javascript code	
 }