function OpenWindow(query,w,h,scroll){var l=(screen.width-w)/2;var t=(screen.height-h)/2;winprops='resizable=0, height='+h+',width='+w+',top='+t+',left='+l+'w';if(scroll)winprops+=',scrollbars=1';var f=window.open(query,"_blank",winprops);}function setLocation(url){window.location.href=url;}function displayAjaxLoading(display){if(display){$('.ajax-loading-block-window').show();}else{$('.ajax-loading-block-window').hide('slow');}}function displayPopupNotification(message,messagetype,modal){var container;if(messagetype=='success'){container=$('#dialog-notifications-success');}else if(messagetype=='error'){container=$('#dialog-notifications-error');}else if(messagetype=='warning'){container=$('#dialog-notifications-warning');}else{container=$('#dialog-notifications-success');}var htmlcode='';if((typeof message)=='string'){htmlcode='
'+message+'
';}else{for(var i=0;i'+message[i]+'';}}container.html(htmlcode);var isModal=(modal?true:false);container.dialog({modal:isModal,width:350});}function displayPopupContentFromUrl(url,title,modal,width){var isModal=(modal?true:false);var targetWidth=(width?width:550);var maxHeight=$(window).height()-20;$('').load(url).dialog({modal:isModal,position:['center',20],width:targetWidth,maxHeight:maxHeight,title:title,close:function(event,ui){$(this).dialog('destroy').remove();}});}var barNotificationTimeout;function displayBarNotification(message,messagetype,timeout){clearTimeout(barNotificationTimeout);var cssclass='success';if(messagetype=='success'){cssclass='success';}else if(messagetype=='error'){cssclass='error';}else if(messagetype=='warning'){cssclass='warning';}$('#bar-notification').removeClass('success').removeClass('error').removeClass('warning');$('#bar-notification .content').remove();var htmlcode='';if((typeof message)=='string'){htmlcode=''+message+'
';}else{for(var i=0;i'+message[i]+'';}}$('#bar-notification').append(htmlcode).addClass(cssclass).fadeIn('slow').mouseenter(function(){clearTimeout(barNotificationTimeout);});$('#bar-notification .close').unbind('click').click(function(){$('#bar-notification').fadeOut('slow');});if(timeout>0){barNotificationTimeout=setTimeout(function(){$('#bar-notification').fadeOut('slow');},timeout);}}function htmlEncode(value){return $('').text(value).html();}function htmlDecode(value){return $('').html(value).text();}function addAntiForgeryToken(data){if(!data){data={};}var tokenInput=$('input[name=__RequestVerificationToken]');if(tokenInput.length){data.__RequestVerificationToken=tokenInput.val();}return data;};