function setcopy(text, alertmsg){
	if( Mo.Browser.msie ) {
		clipboardData.setData('Text', text);
		alert(alertmsg);
	} else if(prompt('Press Ctrl+C Copy to Clipboard', text)) {
		alert(alertmsg);
	}
}

Mo.reader(function(){
				   
	if( Mo("*[mark=option]").size() ){
	
		//高亮当前
		Mo("*[mark=option]").each(function( ele, index ){
			
			var id = location.hash.substr(1);
							   
			var mark = Mo( ele ).attr("option");
			
			if( id && mark == id ){
				
				var img = Mo( ele ).attr({"class":"invite"}).create( 'img', {"src":"source/butterfly.gif"}, true ) ;
				
				img.style({"position":"absolute","marginTop":"-100px"});

				Mo("input",ele).checked( true );
			
			}
							   
		});
		
		//生成拉票按钮
		Mo( document.body ).create( "div", {"id" : "favor"} );
		
		Mo('#favor').hide();
		
		Mo("*[mark=option]").bind("mouseover",function( ele, index ){
				
			var pos = Mo( ele ).position();
			
			var mark = Mo( ele ).attr("option");
			
			var link = location.href.replace(location.hash,"");
			
			Mo("#favor").style({"top":pos.top+5+"px","left":pos.left+pos.width-40+"px"}).html('<a href="#'+mark+'" onclick="setcopy(\''+link+'#'+mark+'\', \'成功复制链接地址\\n\\n可将它发送给你的朋友，让他们参与投票！\');return false;" title="复制地址">拉票</a>').show();
							   
		});
	
	}
	
});