
//change nothing below this line
//
				//
function epoq(params)
{	
	this.getJsonRecommendation=function(xOptions)
	{

		    //function(xOptions)
		    //xOptions = tenantId;
		tenantId = xOptions.tenantId;
		sessionId = xOptions.sessionId;
		productId = xOptions.productId;
		successCallBack = xOptions.success;
		timoutCallback = xOptions.error;
		timeoutinms = xOptions.timeout;
		demo = xOptions.demo;
		rules = xOptions.rules;
		fields = xOptions.fields;
		
	
		var rand_no = Math.random();
		rand_no = rand_no * 10000;
		rand_no = Math.ceil(rand_no);
		var callbackname = "C"+(new Date()).getTime()+"_"+rand_no;
		var getData = "tenantId=" + tenantId + "&sessionId=" + encodeURIComponent(sessionId) + "&productId=" + encodeURIComponent(productId) + "&widgetTheme=json2" ;
		if(typeof(demo) != "undefined")getData+= "&demo=" + demo;
		if(typeof(rules) != "undefined")getData+= "&rules=" + rules;
		if(typeof(fields) != "undefined")getData+= "&fields=" + fields;
		
		
		jQuery.jsonp({
				  url: "http://rs1.epoq.de/inbound-servletapi/getRecommendations", 
				  //dataType: 'jsonp',
				  //data:  getData + "&callback=?",
				  data:  getData + "&callback="+callbackname,
				  callback: callbackname,
				  success: function (data) {  
						successCallBack(data);
				  },
			  	  error: function () {
					  if(typeof(timoutCallback) != "undefined") timoutCallback();
				  	 // alert('error'); // place here the timeout code  
			  	  },
			  	  timeout: timeoutinms
			});
		
				
				
			
				
	}
}
if(typeof(epoq) != "object")epoq = new epoq();				
