function getWidget(params){
	var frameURL = params["websiteUrl"] + "/ypn/adunit?";
	
	if (params["baseAd"] != undefined)
		frameURL = frameURL + "&baseAd=" + params["baseAd"];
	
	if (params["adId"] != undefined)
		frameURL = frameURL + "&adId=" + params["adId"];
	
	if (params["zipcode"] != undefined)
		frameURL = frameURL + "&zip=" + params["zipcode"];
	
	if (params["location"] != undefined)
		frameURL = frameURL + "&loc=" + params["location"];
	
	if (params["query"] != undefined)
		frameURL = frameURL + "&q=" + params["query"];
	
	if (params["theme"] != undefined)
		frameURL = frameURL + "&theme=" + params["theme"];
	
	if (params["linkBack"] != undefined)
		frameURL = frameURL + "&linkBack=" + params["linkBack"];
	
	ifrm = document.createElement("iframe");
	ifrm.setAttribute("src", frameURL);
	ifrm.setAttribute("frameBorder", "0");
	ifrm.setAttribute("scrolling", "no");	
	
	var width = 300;
	var height = 600;
	
	if (params["baseAd"] == 0) {
		height = 380;
	}
	else if (params["baseAd"] == 2) {
		width = 180;
		height = 150;
	}
	
	ifrm.style.width = width+"px";
 	ifrm.style.height = height+"px";
 	
 	var div = document.getElementById(params["divId"]);
 	div.appendChild(ifrm);
}