/**
href=/a -> #a
href=a -> a
Open the page in hash.
1) call first time (from bookmark, or direct), call
2) call when click on href */
var tDelete='האם אתה בטוח כי ברצונך להמשיך במחיקה?';
var documentWidth,documentInnerWidth, documentScrollWidth;
var documentLeftScroll; //Need to add to all absolute left for IE-fix with left scrollbars
if (!window.timeLog) window.timeLog= (function () {});
timeLog('j-start');
$(function() {$(document).triggerHandler('domchange');documentResize()});
$(window).bind('resize',documentResize);
var url,windowWidthWithMargin,windowWidthWithoutMargin,windowHeightWithMargin,windowHeightWithoutMargin,windowWidthWithMarginAndScroll,scrollWidth;
function documentResize()
{
timeLog('documentResize:start');
windowWidthWithMarginAndScroll=$(document.body).outerWidth();
windowWidthWithMargin=$(window).width();
scrollWidth=windowWidthWithMarginAndScroll-windowWidthWithMargin;
windowHeightWithMargin=$(window).height();
windowWidthWithoutMargin=$(window).width() - $(document.body).outerWidth({margin:true})+$(document.body).outerWidth();
windowHeightWithoutMargin=$(window).height() - $(document.body).outerHeight({margin:true})+$(document.body).outerHeight();
documentWidth=windowWidthWithoutMargin;
documentInnerWidth=windowWidthWithoutMargin;
documentScrollWidth=0;
documentLeftScroll= ( documentScrollWidth>0 ? documentScrollWidth : 0);
timeLog('documentResize:end');
}
function windowopen(href)
{//מעבר בין דפים, פונקצית עזר
//אולי פעם נעבור ישירות ללא שימוש בהיסטוריה
//if (!$.cookie('noajax')) {$.historyLoad(href)} else {
var dfdsf;
window.open('?' + href,'_top')
//};
}
//update href. called every time text change.
$(document).bind('domchange.default',function() {
//אם היתה הי פעם בעיה בטעינת דף לטעון אותו כרגיל בלי AJAס
// if (!$.cookie('noajax')) $("a").not(".nohistory").click(historyHref );
timeLog('userBefore');
$("td.user").toolTip({html:toolTipUser,place:'ul'});
timeLog('userAfter');
timeLog('helpBefore');
$("span.help").each(function () {
var $s=$(this)
ht=$s.html();
if (parseInt(ht))
{
}
else
{
timeLog('1');
//$s.html('').insertAfter($s).toolTip({binder:'click',html:'' + ht + '',place:'ul'});
//$s.css('display','inline');
timeLog('4');
}
});
timeLog('helpAfter');
/**Fix PNG
var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
if (badBrowser) {
// get all pngs on page
$('img[src$=.gif]').each(function() {
if (!this.complete) {
this.onload = function() { fixPng(this) };
} else {
fixPng(this);
}
});
}
timeLog('afterFix-Png');*/
// לתקן אינפוטים עבור אינטרנט אקספלורר
//$('input').add('textarea')
if ($.browser.msie) {
$('#inputfix1').add('#inputfix2').add("#inputfix3")
.each( function(){
var $t=$(this);
$tWidth=$t.css('width');
if ($tWidth.indexOf('%')>0 ) {
var wid=parseInt($tWidth)/100;
var newWid=( $t.parent().width() * wid + ( wid==1 ? -5 : 0 ) );
$t.css('width', newWid + 'px');
}
});}
timeLog('after Fix Inputs');
timeLog('forum-Start');
/**
//בשדה תרגומים התחתון לא לעגל בכדי שנוכל לערוך
if (!$.cookie('noresample'))
{
//$(".corner").not( $("#bottom").find('.corner') ).each(function (){ $(this).corner ( $(this).attr('corner')) });
}
$("a.user").css("color","wheat");
timeLog('2-start');
$(".recImage").click(function ()
{
var file= $(this).attr('file');
if (file===undefined) file=$(this).attr('src');
window.open( file , '_top');
}
).css('cursor','hand').attr('title','Click to zoom');
timeLog('3-start');
$("span.deleteimage").add('img.deleteimage').click(function()
{
if (!confirm(tDelete)) return (false);
var tag=$(this).attr("tag");
$.get("/?todo=tables&a=deleteimage&id=" + tag, function(data){ tryData(data) ;});
return(false);
});
timeLog('4-start');
timeLog('5-start');
$("div.border").hover(function (){$(this).css('border','1px solid #334455'); },function(){$(this).css('border','1px solid #ddeeff');});
*/
timeLog('Document data Change');
});
$(function (){
$.ajaxSetup( {timeout:1000*60*10});
//Use in calendar.asp
$("#waitUntilLoadMessage").remove().clone();
var loader=$("#loader");
loader.hide();
loader.ajaxStart (function() {$(this).show(); });
loader.ajaxStop(function() { $(this).hide(); });
loader.ajaxError(function(m,a, b) {/**alert('def:Refresh and try again');$.cookie('noajax',true,{expires:7})*/ });
// loader.ajaxSend(function(m,a, b) {alert('Send-'+a.readyState)});
// loader.ajaxComplete(function(m,b) {if (1==1) alert('def:'+b); });
$("#loader").css("left", $(window).width() /2-5 ).hide();
$("#oldweb").click(whyExit);
$("span.deleterecord").live('click',function()
{
if (!confirm(txtConfirmDelete)) return(false);
var tag=$(this).attr("tag");
var str="?todo=tables&t=" + table_id + "&a=deleterecord&id=" + tag;
$.get(str, function(data){ tryData(data) ;});
return(false);
});
});
function tryData(inScript)
{
try
{
eval(inScript);
}
catch (err)
{
alert('defjsError:' + inScript);
}
}
//שלח חוות דעתך
function whyExit()
{
$("span.whyexit").clone().remove();
var b='
';
var myexit=$(b).appendTo ($("#load"));
myexit.css('left',$(window).width()/2-myexit.width()/2)
.css('top',$(window).height()/2-myexit.height()/2+document.body.scrollTop);
}
var UserChooseLoad=false;
var userChooseP; //מחזיר את כל הנתונים של החלון {title,container,callback}
var chooseUserDiv;
// בתיבת בחירת המשתמשים, הגולש לחץ על משתמש
function usUserClick(inX)
{
cuCloseDo();
userChooseP.callback(inX);
}
//סגירת תיבת המשתמש
function cuCloseDo(){blackScreenHide();chooseUserDiv.remove();UserChooseLoad=false; }
//חלון קופץ
//הצגת חלון בחירת משתמש
// title,container,callback
function defUserChoose(inP)
{
if (UserChooseLoad) return(false);
UserChooseLoad=true;
userChooseP=inP;
var cont=$('#load');
if (inP.container) cont=inP.container;
var b='
@
!
';
chooseUserDiv=$(b).appendTo(cont);
$('#divcuTitle').html(inP.title).hide();
$("#cuClose").click( cuCloseDo );
$('#chooseUserDivList').load('?todo=user&a=chooseuser',defUserChooseLoaded );
$("#chooseUserDivList .pages a").die().live('click',function ()
{
$("#chooseUserDivList").load(this.href,defUserChooseLoaded)
return(false)
});
//$("#usChooseSearchbtn").add("die().live('click',function ()
//{
//return(false); });
}
//רשימת המשתמשים נטענה
function defUserChooseLoaded()
{
blackScreenShow();
UserChooseLoad=false;
$('#chooseuserSearch').ajaxForm({target:'#chooseUserDivList',success:defUserChooseLoaded});
chooseUserDiv.css('left',$(window).width()/2-chooseUserDiv.width()/2) .css('top',$(window).height()/2-chooseUserDiv.height()/2+document.body.scrollTop).css('z-index',2).show();
}
//מסך שחור בכדי להציג משהו מעליו צריך לעשות
//z-index:1
function blackScreenShow()
{;
// blackScreenInterval=window.setInterval('document.body.scrollTop=0',10,'javascript');
$('.divDisableElement').remove();
var divDisable='