function alert_success(n){document.getElementById("alert_custom")!=null&&document.getElementById("alert_custom").remove();document.getElementById("message_main_context").innerHTML+="<div id='alert_custom' class='alert-context-success'><i class='fa fa-check-circle' style='font-size:25px;'><\/i> "+n+"<\/div>";setTimeout(function(){$("#alert_custom").addClass("alert-hide")},1e3);setTimeout(function(){document.getElementById("alert_custom").remove()},3e3)}function alert_error(n){document.getElementById("alert_custom")!=null&&document.getElementById("alert_custom").remove();document.getElementById("message_main_context").innerHTML+="<div id='alert_custom' class='alert-context-error'><i class='fa fa-times-circle' style='font-size:25px;'><\/i> "+n+"<\/div>";setTimeout(function(){$("#alert_custom").addClass("alert-hide")},1e3);setTimeout(function(){document.getElementById("alert_custom").remove()},3e3)}function pagereload(){setTimeout(function(){location.reload()},1e3)}function showproject(){document.getElementById("project").style.display="inherit"}function hideproject(){document.getElementById("project").style.display="none"}function showgallery(){document.getElementById("gallery").style.display="inherit"}function hidegallery(){document.getElementById("gallery").style.display="none"}function show_hide_contact_popup(){myPopup("/Conversation/Index","Live Chat",400,400)}function show_hide_admin_conversation(n){var t="/admin/live-chat/id/"+n;myPopup(t,"Live Chat",400,400)}function myPopup(n,t,i,r){var u=(screen.width-i)/2,f=(screen.height-r)/4,e=window.open(n,t,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width="+i+", height="+r+", top="+f+", left="+u)}function SetConversation_Head(){var n=document.getElementById("SenderName").value,t=document.getElementById("SenderContact").value,i=document.getElementById("ReceiverDepartment").value;if(n=="")return alert_error("Please Type Your Name..."),document.getElementById("SenderName").focus(),!1;if(t=="")return alert_error("Please Type Phone ro Email..."),document.getElementById("SenderContact").focus(),!1;if(i=="")return alert_error("Please Selact Department"),document.getElementById("ReceiverDepartment").focus(),!1;$.ajax({type:"POST",url:"Conversation/SetConversation_Head",data:JSON.stringify({SenderName:n,SenderContact:t,ReceiverDepartment:i}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){n=="Success !"?(alert_success(n),document.getElementById("Name").value="",document.getElementById("Contact").value="",document.getElementById("Email").value="",document.getElementById("MessageBody").value="",$("#contact_popup").toggle(300)):alert_error(n)},error:function(){alert_error("Failed !")}})}function SendMessage(){var n=document.getElementById("MessageBody").value;if(n=="")return alert_error("Please Type Message..."),document.getElementById("MessageBody").focus(),!1;$.ajax({type:"POST",url:"Conversation/SendMessage",data:JSON.stringify({Message:n}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){n=="Success !"?(alert_success(n),document.getElementById("MessageBody").value=""):alert_error(n)},error:function(){alert_error("Failed !")}})}function RemoveByCode(n,t){if(confirm("Do you want to delete ?")==!1)return!1;$.ajax({type:"POST",url:n,data:JSON.stringify({Code:t}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){n=="Success !"?(alert_success(n),setTimeout(function(){location.reload()},1e3)):alert_error(n)},error:function(){alert_error("Failed !")}})}function show_hide_small_menu(){$("#small_navigation").toggle(300)}function goto(n){location.href=n}function ConvertDateAll(n,t,i){function r(n,t){var i=n+"";for(t=t||2;i.length<t;)i="0"+i;return i}var h=["\x00","January","February","March","April","May","June","July","August","September","October","November","December"],c=["\x01","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l=["\x02","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],a=["\x03","Sun","Mon","Tue","Wed","Thu","Fri","Sat"],v=i?n.getUTCFullYear():n.getFullYear(),o,y,u,p,w,b,f,s,k,e,d,nt,tt,g;return t=t.replace(/(^|[^\\])yyyy+/g,"$1"+v),t=t.replace(/(^|[^\\])yy/g,"$1"+v.toString().substr(2,2)),t=t.replace(/(^|[^\\])y/g,"$1"+v),o=(i?n.getUTCMonth():n.getMonth())+1,t=t.replace(/(^|[^\\])MMMM+/g,"$1"+h[0]),t=t.replace(/(^|[^\\])MMM/g,"$1"+c[0]),t=t.replace(/(^|[^\\])MM/g,"$1"+r(o)),t=t.replace(/(^|[^\\])M/g,"$1"+o),y=i?n.getUTCDate():n.getDate(),t=t.replace(/(^|[^\\])dddd+/g,"$1"+l[0]),t=t.replace(/(^|[^\\])ddd/g,"$1"+a[0]),t=t.replace(/(^|[^\\])dd/g,"$1"+r(y)),t=t.replace(/(^|[^\\])d/g,"$1"+y),u=i?n.getUTCHours():n.getHours(),t=t.replace(/(^|[^\\])HH+/g,"$1"+r(u)),t=t.replace(/(^|[^\\])H/g,"$1"+u),p=u>12?u-12:u==0?12:u,t=t.replace(/(^|[^\\])hh+/g,"$1"+r(p)),t=t.replace(/(^|[^\\])h/g,"$1"+p),w=i?n.getUTCMinutes():n.getMinutes(),t=t.replace(/(^|[^\\])mm+/g,"$1"+r(w)),t=t.replace(/(^|[^\\])m/g,"$1"+w),b=i?n.getUTCSeconds():n.getSeconds(),t=t.replace(/(^|[^\\])ss+/g,"$1"+r(b)),t=t.replace(/(^|[^\\])s/g,"$1"+b),f=i?n.getUTCMilliseconds():n.getMilliseconds(),t=t.replace(/(^|[^\\])fff+/g,"$1"+r(f,3)),f=Math.round(f/10),t=t.replace(/(^|[^\\])ff/g,"$1"+r(f)),f=Math.round(f/10),t=t.replace(/(^|[^\\])f/g,"$1"+f),s=u<12?"AM":"PM",t=t.replace(/(^|[^\\])TT+/g,"$1"+s),t=t.replace(/(^|[^\\])T/g,"$1"+s.charAt(0)),k=s.toLowerCase(),t=t.replace(/(^|[^\\])tt+/g,"$1"+k),t=t.replace(/(^|[^\\])t/g,"$1"+k.charAt(0)),e=-n.getTimezoneOffset(),d=i||!e?"Z":e>0?"+":"-",i||(e=Math.abs(e),nt=Math.floor(e/60),tt=e%60,d+=r(nt)+":"+r(tt)),t=t.replace(/(^|[^\\])K/g,"$1"+d),g=(i?n.getUTCDay():n.getDay())+1,t=t.replace(new RegExp(l[0],"g"),l[g]),t=t.replace(new RegExp(a[0],"g"),a[g]),t=t.replace(new RegExp(h[0],"g"),h[o]),t=t.replace(new RegExp(c[0],"g"),c[o]),t=t.replace(/\\(.)/g,"$1"),alert(t),t}function GetDropdown(n,t,i){$.ajax({type:"POST",url:t,data:JSON.stringify({Code:n}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){$("#"+i).empty();$.each(n,function(n,t){var r="<option value='"+t.Value+"'>"+t.Text+"<\/option>";$("#"+i).append(r)})},error:function(){alert("Load Failed !")}})}function triggerFileUpload(n){return document.getElementById(n).click(),!1}function trigger_image_show(n,t){var f=document.getElementById(n).files,r=document.getElementById(t).tagName,i,u;f.length>0&&(i=f[0],i.type=="image/jpeg"||i.type=="image/jpg"||i.type=="image/png"?(u=new FileReader,u.onload=function(n){r=="IMG"?document.getElementById(t).src=n.target.result:r=="DIV"&&(document.getElementById(t).style.backgroundImage="url("+n.target.result+")")},u.readAsDataURL(i)):(alert_error("Please Select Image !"),document.getElementById(n).value=null,r=="IMG"?document.getElementById(t).src="/Images/new_imagew.jpg":r=="DIV"&&(document.getElementById(t).style.backgroundImage="url(/Images/new_imagew.jpg)")))}$(window).ready(function(){var n=$("#page_popup_body").height();$("#page_popup_main").height(n)});$(window).resize(function(){var n=$("#page_popup_body").height();$("#page_popup_main").height(n)});var myPopup;$(window).ready(function(){var n=window.innerHeight;n<380&&(document.getElementById("contact_popup").style.height=n+"px")});$(window).resize(function(){var n=window.innerHeight;n<380&&(document.getElementById("contact_popup").style.height=n+"px")})