var cacheObj = new Object();

/*---\\\ CATALOG LIST FUNCTIONS ///---*/
	
	
	
	
	function list_request(sid){
		//structKeyExists() is a UDF at the bottom of this page ;)
		if( structKeyExists(cacheObj,sid) )		//populate from cache if already retrieved
			details_response(cacheObj[sid]);
		else{									//otherwise make an http() call
			var httpParam = new Object();
				httpParam.sid = sid;
			http( "POST" , "course_catalog.cfc?method=getList" , list_response , httpParam );
		}
	}
	
	
	function article_request(sid){
		//structKeyExists() is a UDF at the bottom of this page ;)
		if( structKeyExists(cacheObj,sid) )		//populate from cache if already retrieved
			details_response(cacheObj[sid]);
		else{									//otherwise make an http() call
			var httpParam = new Object();
				httpParam.sid = sid;
			http( "POST" , "course_catalog.cfc?method=getArticle" , list_response , httpParam );
		}
	}
	
	
	function list_response(obj){ //callback functions always take one argument. This is the result passed back from the server.
		document.getElementById("dynamic_element").innerHTML = obj;
	}		
	function structKeyExists(obj,key){
		for(x in obj){
			if(x == key)
			return true;
		}
	return false;	
	}
	
	function isDefined(argsVar){
		return (eval('typeof('+argsVar+') != "undefined"'))
	}
	  



