function share(permalink_title,permalink) {
    var width=350;
    var height=400;
    var left = Math.floor( (screen.width - width) / 2);
    var top = Math.floor( (screen.height - height) / 2);
    var win = window.open('/card/share.html?permalink='+encodeURIComponent(permalink)+'&permalink_title='+encodeURIComponent(permalink_title),'share','top='+top+',left='+left+',status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1,height='+height+',width='+width);
    win.focus();
}

function share_click(link) {
    window.open(link,'sharer','toolbar=0,status=0,width=700,height=500');
    return false;
}

function recipient_setSelectedValue(from_id, to_id){
	if (document.getElementById){
		from = document.getElementById(from_id);
		to = document.getElementById(to_id);
		
		value = from.value;
		if (value != ''){
			to.value = value;
		}
	}
}

function showHide(name){
	$(name).toggle();
	if($(name).visible()){
		$(name+'-link').update('Less...');
	}else{
		$(name+'-link').update('More...');
	}
}

function maillink(username,hostname,text) {
    if (!text) text = username + '@' + hostname;
    document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + ">" + text + "</a>")
}

