function GamepotApi(){
	// internal variables	///////////////////////////////////////////////////////////////////////
	this.target = "";
	this.num = 15;

	// methods	///////////////////////////////////////////////////////////////////////////////////

	// forumList
	this.getForumList = function(forumids, target, num){
		// get forum thread list of forumids.
		//		forumids = "1" or "1,2,3,.."
		//		target = undefined or "#id", or ".class"  ( jQeury selector )
		//		num = 1 or 2 or .. or 15 ( how many will be shown. max 15 )

		// local variables
		var list="", jsonText="", jsonObj, i;
		if ( forumids==undefined ) forumids = "";
		if ( target==undefined || target=="" ) target = this.target;
		if ( num==undefined || num==0 || num>15 ) num = this.num;

		// get thread
		jQuery.noConflict()(function(){
			jQuery.getScript("http://forum.gamepotusa.com/external.php?type=js&forumids="+forumids, function(){

				// create json object
				for (i=0; i<threads.length; i++ ){
					jsonText = jsonText + (i==0?'':'\n,') + '{"threadid":'+threads[i].threadid+', "title":"'+threads[i].title+'", "poster":"'+threads[i].poster+'", "threaddate":"'+threads[i].threaddate+'", "threadtime":"'+threads[i].threadtime+'"}';
				}
				jsonText = '{ "forumID":"'+forumids+'", "target":"'+target+'", "num":"'+num+'", "forumList": [\n' + jsonText + '\n]}';
				jsonObj = eval('(' + jsonText + ');');


				// forwards to callback if exists
				if ( typeof callbackForumList=='function' ){
					callbackForumList(jsonObj);
					return false;
				}

				// default listing
				if ( target==undefined || target=="" ) return false;
				for (i=0; i<threads.length; i++)
				{
					if ( num==i ) break;
					list = list + "<a href='http://forum.gamepotusa.com/showthread.php?"+ threads[i].threadid +"'>["+threads[i].threadid +"]"+threads[i].title + " (" + threads[i].poster + ")</a><br />";
				}
				jQuery(target).html(list);
			});
		});
	}

}


