var jQueryDM = jQuery;

jQueryDM('window').ready(function(){
   jQueryDM('.dap_member_loading_wrapper').hide();
});



function dap_member_show_loader(){
	jQueryDM('.dap_member_loading_wrapper').show();
}

function dap_member_hide_loader(){
	
	jQueryDM('.dap_member_loading_wrapper').hide();
}
  
/* sweet alert customize popup*/
function dap_member_sweet_alert_message($message){

	swal({
		title: '',
		customClass:' dap_member_sweet_alert_message_class',
		confirmButtonClass:'dap_member_sweet_confirm_class',
		focusConfirm: false,		
		html:'<div class="dap_member_sweet_alert_message_div">'+$message+'</div>',
		showCloseButton: true,
	});
}
 
function dap_member_sweet_alert_popup_with_msg_type($title,$message,$type){
		swal($title , $message ,  $type );
}


function dap_member_show_tab_by_id($tab_id){
	
	
	jQueryDM('html, body').animate({
		scrollTop: 0
	}, 100);
	jQueryDM('#dap_member_page_wrapper a[href="'+$tab_id+'"]').tab('show');
	
}
function dap_member_goto_next_tab($tab_id){
	
	jQueryDM('#dap_member_page_wrapper a[href="'+$tab_id+'"]').trigger('click');
}




function dap_member_tiny_editor() {
		tinymce.init({
        selector: '.dap_member_tiny_editor',
        inline: true,
        height: 500,
        theme: 'modern',
        force_br_newlines: true,
        force_p_newlines: false,
        resize: "both",
        object_resizing: "img",
        forced_root_block: '',
        fontsize_formats: "8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 17pt 18pt 19pt 20pt 22pt 24pt 26pt 30pt",
        theme_advanced_fonts: "Andale Mono=andale mono,times;" + "Arial=arial,helvetica,sans-serif;" + "Arial Black=arial black,avant garde;" + "Book Antiqua=book antiqua,palatino;" + "Comic Sans MS=comic sans ms,sans-serif;" + "Courier New=courier new,courier;" + "Georgia=georgia,palatino;" + "Helvetica=helvetica;" + "Impact=impact,chicago;" + "Symbol=symbol;" + "Tahoma=tahoma,arial,helvetica,sans-serif;" + "Terminal=terminal,monaco;" + "Times New Roman=times new roman,times;" + "Trebuchet MS=trebuchet ms,geneva;" + "Verdana=verdana,geneva;" + "Webdings=webdings;" + "Wingdings=wingdings,zapf dingbats",
        plugins: ['advlist autolink lists link image charmap print preview hr anchor pagebreak', 'searchreplace wordcount visualblocks visualchars code fullscreen', 'insertdatetime media nonbreaking save table contextmenu directionality', 'emoticons template paste textcolor colorpicker textpattern imagetools'],
        toolbar1: 'insertfile undo redo | styleselect | bold italic |  fontselect | fontsizeselect | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
        toolbar2: 'print preview media | forecolor backcolor emoticons | codesample',
        image_advtab: true,
        templates: [{
            title: 'Test template 1',
            content: 'Test 1'
        }, {
            title: 'Test template 2',
            content: 'Test 2'
        }]
    });
}

function dap_member_copy_to_clipboard(obj) {
	jQuery(obj).text('Copied');
	var elementId = jQuery(obj).attr("data-id");
	var aux = document.createElement("input");
	aux.setAttribute("value", document.getElementById(elementId).innerHTML);
	document.body.appendChild(aux);
	aux.select();
	document.execCommand("copy"); 
	document.body.removeChild(aux);
}





