var doc_dialogs={};

$('document').ready(function(){
	
	 
	 var $dialog = $('#privacy_popup')
		.dialog({
			autoOpen: false,
			resizable:false,
			draggable:false,
			width:550,
			height:240,
			title:'Privacy Statement'
		});

	 $('.launchinfopop').click(function(){
	 	//$dialog.dialog('open');
		//$('#privacy_popup').scrollTop(0);
		var id=$(this).attr('id');
		var title=$(this).attr('title');
		if(!doc_dialogs[id]){
			doc_dialogs[id]=$('#'+id+'_popup')
				.dialog({
					autoOpen: false,
					resizable:false,
					draggable:false,
					width:550,
					height:240,
					'title':title
				});
		}
		doc_dialogs[id].dialog('open');
		$('#'+id+'_popup').scrollTop(0);
	 	return false;
	 });
	 
	 $('.profile_more_wrap').each(function(){
	 	var wrap=$(this);
		var content=wrap.find('.profile_more_content');
		var openlink=wrap.find('.profile_more_open_link');
		openlink.click(function(){
			content.fadeIn();
			openlink.slideUp();
			return false;
		});
		wrap.find('.profile_more_close_link').click(function(){
			content.hide();
			openlink.fadeIn();
			return false;
		});
		
	 });
});
