
	function BingSearch(source,lan,loc,count,offset,type,query,callbackFunction){
		if(type=="json"){
			this.mainUrl="http://api.search.live.net/json.aspx?";
		}
		else{
			this.mainUrl="http://api.search.live.net/json.aspx?";
		}
		this.appId="38D2DF122980586FCE3F6FA726F5357C671F74A3";
		this.source=source;
		this.count=count;
		this.offset=offset;
		this.type=type;
		this.version="2.2";
		this.lan=lan;
		this.loc=loc
		this.query=query;
		this.jsonType="callback";
		this.callbackFunction=callbackFunction;
			
	}
	BingSearch.prototype.getUrl=function(){
		var bing_params="&Adult=Moderate&Options=EnableHighlighting&Image.sortBy=Relevance&Image.count=6&Video.Count=4&Video.sortBy=Relevance&Sources="+this.source+"&UILanguage="+this.lan+"&web.Count="+this.count+"&Market="+this.loc+"&web.offset="+this.offset+"&Query="+this.query;
		var url=this.mainUrl+"AppId="+this.appId+"&Version="+this.version+"&JsonType="+this.jsonType+"&JsonCallBack="+this.callbackFunction+bing_params;
		return url;
		
	}
	BingSearch.prototype.getVideoImageUrl=function(){
		var bing_params="&Options=EnableHighlighting&Sources="+this.source+"&UILanguage="+this.lan+"&Video.Count="+this.count+"&Video.offset="+this.offset+"&Video.sortBy=Relevance&Image.sortBy=Relevance&news.sortBy=Date&Image.count="+this.count+"&Market="+this.loc+"&Image.Offset="+this.offset+"&Query=%22"+this.query+"%22";
		var url=this.mainUrl+"AppId="+this.appId+"&Version="+this.version+"&JsonType="+this.jsonType+"&JsonCallBack="+this.callbackFunction+bing_params;
		return url;
		
	}
	BingSearch.prototype.getSpellUrl=function(){
		var bing_params="&Adult=Moderate&Options=EnableHighlighting&Sources="+this.source+"&UILanguage="+this.lan+"&Market="+this.loc+"&Query="+this.query;
		var url=this.mainUrl+"AppId="+this.appId+"&Version="+this.version+"&JsonType="+this.jsonType+"&JsonCallBack="+this.callbackFunction+bing_params;
		return url;
		
	}
	BingSearch.prototype.getTranslateUrl=function(sourceLan, targetLan){
		var bing_params="&Adult=Moderate&Options=EnableHighlighting&Sources="+this.source+"&UILanguage="+this.lan+"&Market="+this.loc+"&Translation.SourceLanguage="+sourceLan+"&Translation.TargetLanguage="+targetLan+"&Query="+this.query;
		var url=this.mainUrl+"AppId="+this.appId+"&Version="+this.version+"&JsonType="+this.jsonType+"&JsonCallBack="+this.callbackFunction+bing_params;
		return url;
	}
