
AWASA.constants={"DISP_KEEP_CUR":"__keep_current_display__","DISP_CLEAR":"__clear_current_display__"}
AWASA.core={JSONRequest:function(req_data,req_url,callback,sync,error_callback){var async=(!sync)?true:false;var defeat_cache=Math.round(10000*Math.random());$.ajax({"async":async,"url":req_url+"?dc="+defeat_cache,"cache":false,"dataType":"json","type":"POST","data":req_data,"success":function(response,code){callback(response,code);return false;},"error":function(xmlsdf,textStatus,errorThrown){if(typeof error_callback!="undefined"){error_callback(xmlsdf,textStatus,errorThrown);}
return false;}});},getAjaxLoader:function(){var ajax_loader="<div class='ajax-loader'><img src='theme/images/ajax-loader-msgs.gif' /></div>";return ajax_loader;},getWindowSize:function(){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}
return{"width":myWidth,"height":myHeight}},showOverlay:function(coords,content,bindery_callback,close_callback){var win_size=AWASA.core.getWindowSize();$('body #overlay').remove();$('body').append(''+'<div id="gray-out" style="background-color:#010101;opacity:.5;width:100%;height:100%;z-index:1000;position:fixed;top:0;left:0"></div>'+'<div id="overlay" style="background-color:#FFFFFF" class="hidden">'+'<div class="content">'+content+'</div></div>');$('#overlay').css({'z-index':'0','display':'block'});var width_offset=(win_size.width/2)-($('#overlay > div.content > div').width()/2);if($('#overlay > div.content > div').width()>win_size.width){width_offset=10;}
var height_offset=(win_size.height/2)-($('#overlay > div.content > div').height()/2);if($('#overlay > div.content > div').height()>win_size.height){height_offset=10;}
$('#overlay').css({"position":"fixed","left":width_offset,"top":height_offset,"z-index":"1001","opacity":"1"});$('#overlay > div.content').css({"overflow":"auto"});$("#overlay").css({"border":"10px solid #C0C0C0","-moz-border-radius":"5px"});if($('#overlay').height()>win_size.height){$('#overlay > div.content').css({"height":(win_size.height-20)});}
if($('#overlay').width()>win_size.width){$('#overlay > div.content').css({"width":(win_size.width-20)});}
$('.close').unbind('click').click(function(){$('#overlay').fadeOut('normal',function(){$('#overlay').html("").remove();$('#gray-out').fadeOut('fast',function(){$("#gray-out").html("").remove();});if(typeof close_callback!="undefined"){close_callback();return false;}});return false;});return bindery_callback();},loadMainBlocks:function(data,bindery_callback,parent_id){if(typeof parent_id=="undefined"){parent_id="";}
if(data.paging!=AWASA.constants.DISP_KEEP_CUR){$(parent_id+" .tab-content-paging").html(data.paging);}
if(data.message_space!=AWASA.constants.DISP_KEEP_CUR){$(parent_id+" .tab-content-message-space").html(data.message_space);$(parent_id+" .tab-content-message-space").css("text-align","right");}
if(data.title!=AWASA.constants.DISP_KEEP_CUR){$(parent_id+" .tab-content-title").html(data.title);}
if(data.content!=AWASA.constants.DISP_KEEP_CUR){$(parent_id+" .tab-content-content").html(data.content);}
bindery_callback(data);},smallSpinner:"<div class='small-spinner'><img src='theme/images/ajax-loader-msgs.gif' /></div>",showSmallSpinner:function(element_selector){$(element_selector).parent().prepend(AWASA.core.smallSpinner);},hideSmallSpinner:function(selector){$(selector).parent().find(" .small-spinner").remove();}}
AWASA.jr=AWASA.core.JSONRequest;AWASA.so=AWASA.core.showOverlay;