		var newWindow;
	function openPopup(popup_width,popup_height,popup_url,popup_name){
			var windowHeight = popup_height;
			var windowWidth = popup_width;
			var windowName = popup_name;
			var windowUri = popup_url;

			var centerWidth = (window.screen.width - windowWidth) / 2;
			var centerHeight = (window.screen.height - windowHeight) / 2;

			if ( !newWindow || newWindow.closed ){
				newWindow = window.open(windowUri, windowName,'addressbar=0,menubar=0,location=0,status=0,scrollbars=yes,resizable=0,width=' + windowWidth + 
					',height=' + windowHeight + 
					',left=' + centerWidth + 
					',top=' + centerHeight);
				try{
					//newWindow.location.href; // throws exception if after reload
					//newWindow.location = windowUri;
				}catch(e){};
			}
			 if ( newWindow && ! newWindow.closed ){
				newWindow.location.assign(windowUri);
				newWindow.focus();
			}
	}
	
	function adsPopup(popup_url , target ,popup_width,popup_height){
		if(target.toLowerCase() == "_self"){
			window.location.assign(popup_url);
		}else if(target.toLowerCase() == "_blank" && popup_width && popup_height){
			openPopup(popup_width,popup_height,popup_url);
		}else{
			if ( !newWindow || newWindow.closed ){
				window.open(popup_url,"newWindow")
				try{
				}catch(e){};
			}
			 if ( newWindow && ! newWindow.closed ){
				newWindow.focus();
			}
		}
	
	}