function closeBadge(){
	//alert(js_obj_UEP);
	//if(event.target);
	js_obj_UEP.style.display="none";
}
var position_new;
var js_obj_UEP;
function callbackFeedback(productID,position){
	var closeGif="http://www.webexlabs.com/support/images/closeDiv1.gif";
	var image_UEP1="http://www.webexlabs.com/support/images/badge.png";
	var image_UEP2="http://www.webexlabs.com/support/images/badge.gif";
	if(position=="null")
		position=0;
	position_new = position;
	//var image2="http://172.16.230.224:8080/support/images/badge_1.GIF";
	js_obj_UEP = document.createElement("div");
	js_obj_UEP.style.position="absolute";
	js_obj_UEP.style.zIndex="9999";
	js_obj_UEP.style.display="block";
	//js_obj_UEP.setAttribute("src", url);
	var a_UEP = document.createElement("a");
	//alert(a);
	a_UEP.href="http://www.webexlabs.com/support/index.jsp?pageUID=" + productID;
	a_UEP.target="_blank";
	var imageUEP = document.createElement("img");
	imageUEP.id="img_badge";
	if(document.all){
		imageUEP.src=image_UEP2;
		if(imageUEP.readyState!='complete'){
	   		imageUEP.width = 71;
	   		imageUEP.height = 89;
		}else{
			imageUEP.width = 71;
	   		imageUEP.height = 89;
		}
	}else{
		imageUEP.src=image_UEP1;
	}
	
	imageUEP.border="0";
	
	a_UEP.appendChild(imageUEP);
		
	imageClose_UEP = document.createElement('img');
	imageClose_UEP.id="divClose";
	imageClose_UEP.src=closeGif;
	imageClose_UEP.border="0";
	imageClose_UEP.style.position="absolute";
	imageClose_UEP.style.cursor="pointer";
	//imageClose.innerHtml="<font style='font-family:Arial, Helvetica, sans-serif; font-weight:bold; font-size:9px'>Close</font>";
	
	js_obj_UEP.appendChild(a_UEP);
	js_obj_UEP.appendChild(imageClose_UEP);
	
	if(document.body==null){
		document.write("<body></body>");
	}
	document.body.appendChild(js_obj_UEP);
		
	//alert("width="+screenWidth+";height="+screenHeight);
	resizeUEP();
	var close1= document.getElementById("divClose");
	
	imageClose_UEP.onclick=function(){
		return closeBadge();
	}
	//alert(window.attachEvent);
	if(window.attachEvent){
		window.attachEvent("onresize",resizeUEP1);
		window.attachEvent("onscroll",resizeUEP1);
	}else if(window.addEventListener){
		window.addEventListener('resize',resizeUEP,false);
		window.addEventListener("scroll",resizeUEP,false);
	}
	
	
}

function resizeUEP1(){
	setTimeout("resizeUEP()",100);
}
function resizeUEP(){
	//alert("scroll");
	var tempClientWidth = document.documentElement.clientWidth;
	var tempClientHeight = document.documentElement.clientHeight;
    var tempScrollLeft = document.documentElement.scrollLeft;
	var tempScrollTop = document.documentElement.scrollTop;
	if(tempClientWidth == 0){
		tempClientWidth = document.body.clientWidth;
		tempClientHeight = document.body.clientHeight;
		tempScrollLeft=  document.body.scrollLeft;
		tempScrollTop = document.body.scrollTop;
	}

	screenWidth = tempClientWidth-js_obj_UEP.clientWidth+tempScrollLeft;
	screenHeight = tempClientHeight-js_obj_UEP.clientHeight+tempScrollTop;
	if(position_new==0){
		js_obj_UEP.style.top=tempScrollTop+"px";
		js_obj_UEP.style.left=tempScrollLeft+"px";
		imageClose_UEP.style.top=15+"px";
		imageClose_UEP.style.left="0";
	}else if(position_new == 1){
		js_obj_UEP.style.top=tempScrollTop+"px";
		js_obj_UEP.style.left=screenWidth+"px";
		imageClose_UEP.style.left=js_obj_UEP.clientWidth-imageClose_UEP.clientWidth+"px";
	}else if(position_new == 2){
		js_obj_UEP.style.top=screenHeight+"px";
		js_obj_UEP.style.left=tempScrollLeft+"px";
		imageClose_UEP.style.left="0px";
	}else if(position_new == 3){
		js_obj_UEP.style.top=screenHeight+"px";
		js_obj_UEP.style.left=screenWidth+"px";
		imageClose_UEP.style.left=js_obj_UEP.clientWidth-imageClose_UEP.clientWidth+"px";
	}	
}




