objDimensions={
	top:function(o){
		var p=true
		var i=0
		while(p&&o.tagName!="BODY"&&o.tagName!="HTML"){
			i+=o.offsetTop
			if(o.offsetParent!=null)
				o=o.offsetParent
			else
				p=false
		}
		return i
	},
	left:function(o){
		var i=0
		while(o.tagName!="BODY"&&o.tagName!="HTML"){
			i+=o.offsetLeft
			o=o.offsetParent
		}
		return i
	},
	height:function(o){
		return o.offsetHeight
	},
	width:function(o){
		return o.offsetWidth
	}
}

rssSelector={
	rssURI:"",
	container:null,
	show:function(parentObj){
		this.rssURI=parentObj.href
		if(this.container==null){
			this.createPanel()
		}
		this.drawPanel();
		this.container.style.display='block'
		this.container.style.left=(objDimensions.left(parentObj)-20)+"px"
		this.container.style.top=(objDimensions.top(parentObj)-175)+"px"
		if(((objDimensions.top(this.container)-((typeof window.pageYOffset!='undefined')?window.pageYOffset:((typeof document.documentElement!='undefined')?document.documentElement.scrollTop:document.body.scrollTop)))+objDimensions.height(this.container))>((navigator.userAgent.indexOf("Mac")>0)?((typeof window.innerHeight!='undefined')?window.innerHeight:document.body.clientHeight):((typeof window.innerHeight!='undefined')?window.innerHeight:((document.documentElement)?document.documentElement.clientHeight:document.body.offsetHeight)))){
			var containerTop = ((((navigator.userAgent.indexOf("Mac")>0)?((typeof window.innerHeight!='undefined')?window.innerHeight:document.body.clientHeight):((typeof window.innerHeight!='undefined')?window.innerHeight:((document.documentElement)?document.documentElement.clientHeight:document.body.offsetHeight)))-objDimensions.height(this.container))+((typeof window.pageYOffset!='undefined')?window.pageYOffset:((typeof document.documentElement!='undefined')?document.documentElement.scrollTop:document.body.scrollTop))-24);
			if(containerTop > 0){
				this.container.style.top =  containerTop+"px";
			}
		}
		
		if(((objDimensions.left(this.container)-((typeof window.pageXOffset!='undefined')?window.pageXOffset:((typeof document.documentElement!='undefined')?document.documentElement.scrollLeft:document.body.scrollLeft)))+objDimensions.width(this.container))>((navigator.userAgent.indexOf("Mac")>0)?((typeof window.innerWidth!='undefined')?window.innerWidth:document.body.clientWidth):((typeof window.innerWidth!='undefined')?window.innerWidth:((document.documentElement)?document.documentElement.clientWidth:document.body.offsetWidth)))){
			containerLeft = ((((navigator.userAgent.indexOf("Mac")>0)?((typeof window.innerWidth!='undefined')?window.innerWidth:document.body.clientWidth):((typeof window.innerWidth!='undefined')?window.innerWidth:((document.documentElement)?document.documentElement.clientWidth:document.body.offsetWidth)))-objDimensions.width(this.container))+((typeof window.pageXOffset!='undefined')?window.pageXOffset:((typeof document.documentElement!='undefined')?document.documentElement.scrollLeft:document.body.scrollLeft))-180);
			if(containerLeft > 0){
				this.container.style.left =  containerLeft+"px";
			}
		}
	},
	hide:function(){
		this.container.style.display='none'
	},
	drawPanel:function(){
    var tempHTML = '<div id="mvRss" class="rssWindow">'
		tempHTML += '		<img src="/images/rss/gradientbackground.gif" alt="Background image"  height="216" width="320" border="0" />'
		tempHTML += '		<table cellpadding="0" cellspacing="8" align="center" style="position:absolute;left:5px; top:0px">'
		tempHTML += '			<tr>'
		tempHTML += '				<td valign="top" colspan="2" ><span style="font-family:Arial; font-size:20px; color:#31659C; font-weight:bold;">Subscribe Now</span> </td>'
		tempHTML += '				<td align="right" valign="top"> <img alt="Close this window" src="/images/rss/Xclose.gif" border="0" onclick="rssSelector.hide()" /></td>'
		tempHTML += '			</tr>'
		tempHTML += '			<tr><td  colspan="4" valign="top"><span style="font-family:Arial; font-size:11px; font-weight:bold; color:#666666;">With these readers: </span> </td></tr>'
		tempHTML += '			<tr>'
		tempHTML += '				<td><a href="#" onclick="MM_openBrWindow(\'http://add.my.yahoo.com/rss?url='+this.rssURI+'\',\'\',\'\');return false"><img src="/images/rss/addYahoo_but.gif" width="91" height="17" border="0" alt="My Yahoo Reader" /></a></td>'
		tempHTML += '				<td><a href="#" onclick="MM_openBrWindow(\'http://fusion.google.com/add?feedurl='+this.rssURI+'\',\'\',\'\');return false"><img border="0" src="/images/rss/addGoogle_but.gif" width="91" height="17" alt="Google Reader" /></a></td>'
		tempHTML += '				<td><a href="#" onclick="MM_openBrWindow(\'http://client.pluck.com/pluckit/prompt.aspx?GCID=C12286x053&a='+this.rssURI+'\');return false"><img border="0" src="/images/rss/addPluck_but.gif" width="91" height="17" alt="Google Reader" /></a></td>'
		tempHTML += '			</tr>'
		tempHTML += '			<tr>'
		tempHTML += '				<td><a href="#" onclick="MM_openBrWindow(\'http://www.live.com/?add='+this.rssURI+'\',\'\',\'\');return false"><img border="0" src="/images/rss/windowsLive_but.gif" width="92" height="17" alt="Bloglines Reader" /></a></td>'
		tempHTML += '				<td align="center"><a href="#" onclick="MM_openBrWindow(\'http://my.msn.com/addtomymsn.armx?id=rss&ut='+this.rssURI+'\',\'\',\'\');return false"><img border="0" src="/images/rss/myMsn_but.gif" width="80" height="14" alt="Netvibes Reader" /></a></td>'
		tempHTML += '				<td><a href="#" onclick="MM_openBrWindow(\'http://www.newsgator.com/ngs/subscriber/subext.aspx?url='+this.rssURI+'\',\'\',\'\');return false"><img border="0" src="/images/rss/addNewsgator_but.gif" width="91" height="17" alt="Newsgator Reader" /></a></td>'
		tempHTML += '			</tr>'
		tempHTML += '			<tr>'
		tempHTML += '				<td><a href="#" onclick="MM_openBrWindow(\'http://www.netvibes.com/subscribe.php?url='+this.rssURI+'\',\'\',\'\');return false"><img border="0" src="/images/rss/addNetvibes_but.gif" width="91" height="17" alt="Netvibes Reader" /></a></td>'
		tempHTML += '				<td align="center"><a href="#" onclick="MM_openBrWindow(\'http://feeds.my.aol.com/add.jsp?url='+this.rssURI+'\',\'\',\'\');return false"><img border="0" src="/images/rss/addAol_but.gif" width="63" height="14" alt="AOL Reader"></a></td>'
		tempHTML += '				<td><a href="#" onclick="MM_openBrWindow(\'http://www.bloglines.com/sub/'+this.rssURI+'\',\'\',\'\');return false"><img border="0" src="/images/rss/addBloglines_but.gif" width="91" height="17" alt="Bloglines Reader" /></a></td>'
		tempHTML += '			</tr>'
		tempHTML += '			<tr>'
		tempHTML += '				<td  colspan="3"><span style="font-family:Arial; font-size:11px; font-weight:bold; color:#666666;">Or copy the rss link:</span> <br/>'
		tempHTML += '				<input value="'+this.rssURI+'" size="48" style="font-family:Arial; font-size:11px; color:#0253B7;" onClick="this.select();"></input>'
		tempHTML += '				</td>'
		tempHTML += '			</tr>'
		tempHTML += '		</table>'
		tempHTML += '	</div>'
		this.container.innerHTML=tempHTML
  },
	createPanel:function() {
		this.container=document.createElement('div')
		this.container.style.position='absolute'
		this.container.id='rssSelectorContainer'
		this.container.style.display='none'
		this.container.style.margin='0px'
		this.container.style.padding='0px'
		this.container.style.borderWidth='0px'
		this.container.style.left='0px'
		this.container.style.top='0px'			
		document.body.appendChild(this.container)
		
	}
}
