function addFlashError(error){jq('#tixwise_flash_container').append("<div class='flash_error_content flash_bar_content'><p>"+error+"</p></div>");}
function addFlashInfo(info){jq('#tixwise_flash_container').append("<div class='flash_info_content flash_bar_content'><p>"+info+"</p></div>");}
function addFlashNotice(notice){jq('#tixwise_flash_container').append("<div class='flash_notice_content flash_bar_content'><p>"+notice+"</p></div>");}
function clearFlashContainer(){jq('#tixwise_flash_container').children().remove();}
function redirect(url){window.location.replace(url);}
function reload(){window.location.reload();}
function showMessage(title,messageContent){var dialog=jq("<div title='"+title+"'></div>");dialog.html(jq(messageContent).html());jq(dialog).dialog({resizable:false,modal:true});}
function alert(msg){showMessage('הודעה',"<div><div class='ui-dialog-content ui-widget-content' id='dialog'><p>"+msg+"</p></div></div>");}
function randomString(length){var chars;if(jq('#coupon_numeric_only').attr("checked")){chars='123456789'.split('');}
else{chars='123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ'.split('');}
if(!length){length=Math.floor(Math.random()*chars.length);}
var str='';for(var i=0;i<length;i++){str+=chars[Math.floor(Math.random()*chars.length)];}
return str;}
function toggleVisibility(elementId,bShouldShow)
{var jqElement=jq('#'+elementId);if(bShouldShow)
{jqElement.show();}
else
{jqElement.hide();}}
function getCookie(name){var re=new RegExp(name+"=[^;]+","i");if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return null}
function setCookie(name,value){document.cookie=name+"="+value}
function pleaseWaitBlock(divId,showOverlay){var message='<h1 style="margin-top: 20px">'+indexLocale.pleaseWaitHeader+'</h1><img src="/images/login/login_ajax.gif" style="margin-bottom: 20px" align="middle"/>';var bNeedToShowOverlay=true;if(typeof showOverlay!=='undefined'){bNeedToShowOverlay=showOverlay;}
if(divId){if(divId instanceof jQuery){divId.block({message:message,showOverlay:bNeedToShowOverlay});}
else{jq('#'+divId).block({message:message,showOverlay:bNeedToShowOverlay});}}else{jq.blockUI({message:message,showOverlay:bNeedToShowOverlay});}}
function parseIntAndClean(val)
{var newVal=parseInt(val);if(isNaN(newVal))
{newVal=0;}
return newVal;}
