$.extend({URLEncode:function(c){ return c; /* var o='';var x=0;c=c.toString(); var r=/(^[a-zA-Z0-9_.]*)/; while(x1 && m[1]!=''){ o+=m[1];x+=m[1].length; }else{ if(c[x]==' ') o+='+'; else { var d=c.charCodeAt(x);var h=d.toString(16); o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++; } } return o; }, URLDecode:function(s){ var o=s;var binVal,t; var r=/(%[^%]{2})/; while((m=r.exec(o))!=null && m.length>1 && m[1]!=''){ b=parseInt(m[1].substr(1),16); t=String.fromCharCode(b); o=o.replace(m[1],t); }return o; */ } }); (function($) { $.fn.customFadeIn = function(speed, callback) { $(this).fadeIn(speed, function() { if(!$.support.opacity) $(this).get(0).style.removeAttribute('filter'); if(callback != undefined) callback(); }); }; $.fn.customFadeOut = function(speed, callback) { $(this).fadeOut(speed, function() { if(!$.support.opacity) $(this).get(0).style.removeAttribute('filter'); if(callback != undefined) callback(); }); }; $.fn.customFadeTo = function(speed,to,callback) { return this.animate({opacity: to}, speed, function() { if (to == 1 && jQuery.browser.msie) this.style.removeAttribute('filter'); if (jQuery.isFunction(callback)) callback(); }); }; })(jQuery); function handleRelLinks(linkrel) { $('a[rel='+linkrel+']').click(function () { //grab the full url var hash = this.href; //remove the # value if(!jQuery.browser.msie) hash = hash.replace(/^.*\.reidin\.com\//, '/'); hash = hash.replace(/^.*#/, ''); //for back button $.historyLoad(hash); return false; //window.location.href = this.href; }); } function urlencode (str) { // URL-encodes string // // version: 1008.1718 // discuss at: http://phpjs.org/functions/urlencode // + original by: Philip Peterson // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + input by: AJ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + input by: travc // + input by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Lars Fischer // + input by: Ratheous // + reimplemented by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Joris // + reimplemented by: Brett Zamir (http://brett-zamir.me) // % note 1: This reflects PHP 5.3/6.0+ behavior // % note 2: Please be aware that this function expects to encode into UTF-8 encoded strings, as found on // % note 2: pages served as UTF-8 // * example 1: urlencode('Kevin van Zonneveld!'); // * returns 1: 'Kevin+van+Zonneveld%21' // * example 2: urlencode('http://kevin.vanzonneveld.net/'); // * returns 2: 'http%3A%2F%2Fkevin.vanzonneveld.net%2F' // * example 3: urlencode('http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a'); // * returns 3: 'http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a' str = (str+'').toString(); // Tilde should be allowed unescaped in future versions of PHP (as reflected below), but if you want to reflect current // PHP behavior, you would need to add ".replace(/~/g, '%7E');" to the following. return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28'). replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+'); } function clientLog(label) { var d = new Date(); sec = d.getSeconds(); ms=d.getMilliseconds(); //$(".log").html($(".log").html() + "
" + label + sec + "." + ms); } function sure(type,submitobje){ var msj= "Are you sure to "; switch (type){ case 'del': msj += "Delete this record! \n"; break; case 'upd': msj += "Update this record! \n"; break; case 'edt': msj += "Edit this record! \n"; case 'jed': msj = "Do you really want to "+submitobje.value+"!\n"; break; } if(confirm(msj)){ return true; } else{ return false; } } function stripHTML(oldString) { if(oldString == undefined) return ""; //oldString = oldString.replace(/<","<").replace(">",">"); return oldString.replace(/(<[^>]+>)/ig,""); } function submitform(obje){ eval("var formobje=document.forms."+obje); formobje.submit(); } function in_array( what, where ) { var a=false; for(var i=0;i 0) { $("#t_" + grid).html($("#" + pager).html().replace("ui-icon-seek-next", "ui-icon-seek-next-top").replace("ui-icon-seek-prev", "ui-icon-seek-prev-top") .replace("ui-icon-seek-first", "ui-icon-seek-first-top").replace("ui-icon-seek-end", "ui-icon-seek-end-top") .replace("ui-pg-input", "ui-pg-input-top") ); $("#t_" + grid).css("padding-bottom","4px");//.css("width","973px"); } //-----store jqgrids url as search query-----// searchquery = $("#" + grid).getGridParam('url'); //-----creating pagination numbers-----// var totalpage = $("#" + grid).getGridParam('lastpage'); var currentpage = $("#" + grid).getGridParam('page'); var pagination = ""; if(currentpage>99) var pagetoshow = 5; else var pagetoshow = 10; if(totalpage > parseInt(currentpage) + 4 && 0 < parseInt(currentpage) - 4) { start = currentpage-4; end = parseInt(currentpage) + 4; } else if(totalpage > parseInt(currentpage) + 4) { start = 1; if(totalpage >= pagetoshow) end = pagetoshow; else end = totalpage; } else if(0 < parseInt(currentpage) - 4) { if(totalpage -pagetoshow < 0) start = 1; else start = totalpage-pagetoshow; end = totalpage; } else if(totalpage <= pagetoshow) { start = 1; end = totalpage; } else { start = 1; end = totalpage; } hash = location.href.replace(/#.*\.reidin\.com\/$/, '#'); hash = hash.replace(/^.*\.reidin\.com\//, ''); hash = hash.replace(/.*#/, ''); hash = hash.replace(/^\//, ''); hasharr = hash.split("/"); hash = hasharr[0]; // hash = hash.replace(/\/.*$/, ''); // alert(hash) // hash = hash.replace('/' + grid + 'p\d*\//', ''); pagination += "    "; pagination += "    "; for(var a=start;a<=end;a++) { if(currentpage == a) pagination += "" + a + " "; else pagination += "" + a + " "; } pagination += "    "; pagination += "    "; //-----adjusting pager width-----// $("#" + pager + "_left").attr("id",pager + "_left2"); $("#" + pager + "_left").css("width","300px"); $("#" + pager + "_left2").css("width","300px"); $("#" + pager + "_center").css("width","450px"); $("#" + pager + "_center2").css("width","450px"); if(currentpage > 1) { $("#" + pager + "_left2 .ui-icon-seek-prev-top").css("cursor","pointer"); $("#" + pager + "_left2 .ui-icon-seek-first-top").css("cursor","pointer"); } if(totalpage > currentpage) { $("#" + pager + "_left2 .ui-icon-seek-next-top").css("cursor","pointer"); $("#" + pager + "_left2 .ui-icon-seek-end-top").css("cursor","pointer"); } //-----switching to no records div-----// var viewDiv = $("#gbox_" + grid).parent().parent().parent().parent().parent().attr("id"); if(viewDiv == "") viewDiv = $("#gbox_" + grid).parent().parent().parent().parent().parent().parent().attr("id"); if(viewDiv == "") viewDiv = $("#gbox_" + grid).parent().parent().parent().parent().parent().parent().parent().attr("id"); var detail = 0; if(!viewDiv.match(/Inner/)) viewDiv = viewDiv + "Inner"; /*if(!viewDiv) { viewDiv = $("#gbox_" + grid).parent().parent().parent().parent().parent().parent().parent().attr("id"); detail = 1; }*/ /*if($("#" + grid + "pagerInfo").html().search(grid) > 0 && $("#t_" + grid + " .ui-paging-info").html() != "No records to view") { $("#" + grid + "pagerInfo").html(""); if(!detail) changeTab(viewDiv); else changeDetailTab(viewDiv); }*/ $("#" + pager + " #" + pager + "_center").html(": Your access does not cover this data"); var noRecordTexts = new Array; noRecordTexts['myalertsgrid']="You have no alerts yet. Select options on the left panel and click save button"; if($("#t_" + grid + " .ui-paging-info").html() == "No records to view") { if(noRecordTexts[grid] != undefined) $("#t_" + grid + " .ui-paging-info").html(noRecordTexts[grid]) $("#" + grid + "pagerInfo").html("" + $("#t_" + grid + " .ui-paging-info").html() + ""); $("#" + viewDiv).customFadeOut(1); $("#" + viewDiv).addClass("phaseout"); $(".gridlegend").addClass("phaseout"); } else { //-----Setting paging info string-----// var paging_info = $("#t_" + grid + " .ui-paging-info").html().replace("{pagenumber}",currentpage).replace("{totalpages}",totalpage).replace("{recordcount}",$("#" + grid).getGridParam('reccount')); paging_info_array = paging_info.split(" "); paging_info_array[1] = paging_info_array[1].replace(/\./g,thousandSeperator); paging_info = paging_info_array.join(" "); $("#t_" + grid + " #" + pager + "_center").html(paging_info); $("#t_" + grid + " #" + pager + "_center").attr("id",pager + "_center2"); $("#t_" + grid + " #" + pager + "_center2").html(paging_info); if($("#" + grid + "pagerInfo").html().search(grid) > 0) { $("#" + grid + "pagerInfo").html(""); $("#" + viewDiv).customFadeIn(1); // $("#" + viewDiv).css('display',''); $("#" + viewDiv).removeClass("phaseout"); } if(viewDiv.match(/Detail/)) { $("#" + viewDiv.replace('Inner','').replace('Detail','Href')).parent().removeClass("phaseout"); } $(".gridlegend").removeClass("phaseout"); } //-----creating button menu-----// $("#t_" + grid + " .ui-paging-info").html($("#" + grid + "buttonMenu").html().replace(/#cb_grid/g, "#cb_" + grid)); $("#" + pager + " .ui-paging-info").html($("#" + grid + "buttonMenu").html().replace(/#cb_grid/g, "#cb_" + grid)); //-----initializing pagination-----// if($("#" + pager + "_left .customPagination").length > 0) { $("#" + pager + "_left .customPagination").html(pagination); $("#" + pager + "_left2 .customPagination").html(pagination); } else { if($("#" + pager + "_left").find(".ui-pg-table").find("tr").find("td#prev").length>0) { $("#" + pager + "_left").find(".ui-pg-table").find("tr").find("td#prev").after('' + pagination + ''); } else { pag = $("#" + pager + "_left .ui-pg-table tbody tr"); if(pag.length>0) $("#" + pager + "_left .ui-pg-table tbody tr").html(pag[0].innerHTML.substr(0,pag[0].innerHTML.search(/ui-icon-seek-prev/) + 31) + '' + pagination + '' + pag[0].innerHTML.substr(pag[0].innerHTML.search(/ui-icon-seek-prev/) + 31)); } if($("#" + pager + "_left2").find(".ui-pg-table").find("tr").find("td#prev").length>0) { $("#" + pager + "_left2").find(".ui-pg-table").find("tr").find("td#prev").after('' + pagination + ''); } else { pag = $("#" + pager + "_left2 .ui-pg-table tbody tr"); if(pag.length>0) $("#" + pager + "_left2 .ui-pg-table tbody tr").html(pag[0].innerHTML.substr(0,pag[0].innerHTML.search(/ui-icon-seek-prev/) + 62) + '' + pagination + '' + pag[0].innerHTML.substr(pag[0].innerHTML.search(/ui-icon-seek-prev/) + 62)); } } $("#" + pager + "_left").find(".ui-pg-table").find("tr").find("td#prev").remove(); $("#" + pager + "_left").find(".ui-pg-table").find("tr").find("td#next").remove(); $("#" + pager + "_left").find(".ui-pg-table").find("tr").find("td#last").remove(); $("#" + pager + "_left").find(".ui-pg-table").find("tr").find("td#first").remove(); $("#" + pager + "_left2").find(".ui-pg-table").find("tr").find("td#prev").remove(); $("#" + pager + "_left2").find(".ui-pg-table").find("tr").find("td#next").remove(); $("#" + pager + "_left2").find(".ui-pg-table").find("tr").find("td#last").remove(); $("#" + pager + "_left2").find(".ui-pg-table").find("tr").find("td#first").remove(); //-----checking selected rows-----// var selectedids = getCookie(grid.replace("grid","") + "Selected").split(","); for(i = 0; i < selectedids.length; i++) { if(selectedids[i].length > 0) {$("#" + grid).setSelection(selectedids[i],false);} } $('#gview_' + grid + ' a[rel=ajaxpaging], #'+pager+' a[rel=ajaxpaging]').click(function () { $("#" + grid).setGridParam({ page: this.href.substr(this.href.search(/gridp/) + 5) }); initialPage = 0 $("#" + grid).trigger("reloadGrid"); var hash = this.href; if(!jQuery.browser.msie) hash = hash.replace(/^.*\.reidin\.com\//, ''); hash = hash.replace(/^.*#/, ''); $.historyLoad(hash); return false; }); if(!in_array(grid,excludeCheckDisabling)) { var griddata = $("#" + grid).getDataIDs(); for(i=0;i-1) uncheck = 0; } if(uncheck) { $("#jqg_" + escapeSelector(griddata[i])).attr("checked", ""); $("#jqg_" + escapeSelector(griddata[i])).attr("disabled", "true"); } } } } } $('a[rel=ajaxsearch]').click(function () { /*$("#" + grid).setGridParam({ url: this.href }); $("#" + grid).trigger("reloadGrid"); var hash = this.href; if(!jQuery.browser.msie) hash = hash.replace(/^.*\.reidin\.com\//, ''); hash = hash.replace(/^.*#/, ''); $.historyLoad(hash);*/ $("#" + grid).setGridParam({url:this.href}).trigger("reloadGrid"); return false; }); $("#" + pager + "_left .ui-icon-seek-next").unbind(); $("#" + pager + "_left .ui-icon-seek-prev").unbind(); $("#" + pager + "_left .ui-icon-seek-first").unbind(); $("#" + pager + "_left .ui-icon-seek-end").unbind(); $("#" + pager + "_left2 .ui-icon-seek-next-top").unbind(); $("#" + pager + "_left2 .ui-icon-seek-prev-top").unbind(); $("#" + pager + "_left2 .ui-icon-seek-first-top").unbind(); $("#" + pager + "_left2 .ui-icon-seek-end-top").unbind(); $("#" + pager + "_left .ui-icon-seek-next").click(function(){$("#" + gridglobal).setGridParam({page: parseInt(currentpage) + 1}).trigger("reloadGrid");}); $("#" + pager + "_left .ui-icon-seek-prev").click(function(){$("#" + gridglobal).setGridParam({page: parseInt(currentpage) - 1}).trigger("reloadGrid");}); $("#" + pager + "_left .ui-icon-seek-first").click(function(){$("#" + gridglobal).setGridParam({page: 1}).trigger("reloadGrid");}); $("#" + pager + "_left .ui-icon-seek-end").click(function(){$("#" + gridglobal).setGridParam({page: totalpage}).trigger("reloadGrid");}); $("#" + pager + "_left2 .ui-icon-seek-next-top").click(function(){$("#" + gridglobal).setGridParam({page: parseInt(currentpage) + 1}).trigger("reloadGrid");}); $("#" + pager + "_left2 .ui-icon-seek-prev-top").click(function(){$("#" + gridglobal).setGridParam({page: parseInt(currentpage) - 1}).trigger("reloadGrid");}); $("#" + pager + "_left2 .ui-icon-seek-first-top").click(function(){$("#" + gridglobal).setGridParam({page: 1}).trigger("reloadGrid");}); $("#" + pager + "_left2 .ui-icon-seek-end-top").click(function(){$("#" + gridglobal).setGridParam({page: totalpage}).trigger("reloadGrid");}); $(".s-ico").css("display",""); if(typeof afterGridLoad == 'function') afterGridLoad(grid); //alert(grid+'AfterGridLoad'); if(eval('(typeof('+grid+'AfterGridLoad)!="undefined")')) { eval(grid+'AfterGridLoad()'); } $("#modal_grid_overlay").css('display','none'); searchstrarr = $("#" + grid ).getGridParam("url").match(/&Search=(.*?)&/); if(searchstrarr == null) searchstrarr = $("#" + grid ).getGridParam("url").match(/&SearchText=(.*?)&/); if(searchstrarr!=null && searchstrarr && searchstrarr[1] && urlDecode(searchstrarr[1]) != 'Type a keyword to search') { if($("#searchedString").length == 0) $("#results").prepend('
'); $("#searchedString").html("You have searched for `" + urlDecode(searchstrarr[1]) + "`
"); } else if(searchstrarr!=null && urlDecode(searchstrarr[1]) == 'Type a keyword to search') { if($("#searchedString").length == 0) $("#results").prepend('
'); $("#searchedString").html(""); } } Array.prototype.unique = function() { var a = []; var l = this.length; for(var i=0; i-1) uncheck = 0; } if(uncheck && !in_array(gridname + "grid",excludeCheckDisabling)) $("#jqg_" + escapeSelector(rowid)).attr("checked", ""); } } } else { for(i=0;i-1) uncheck = 0; } if(uncheck && !in_array(gridname + "grid",excludeCheckDisabling)) $("#jqg_" + escapeSelector(rowid)).attr("checked", ""); } } else { cookie.splice(cookie.indexOf(rowid),1) } setCookie(gridname + "Selected",cookie,1); } function trim(str) { return str.replace(/^\s+|\s+$/, ''); }; function escapeSelector(str) { return str.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|\/])/g, "\\$1");} //for resizing of myrebis save menu tooltip function closeGridMenu(givenHeight,gridName) { $('#'+gridName).css({'height':$('#'+gridName).height()-givenHeight}); } //for custom popup menus to disappear when clicked elsewhere function checkParent(t,div){ while(t.parentNode){ if(t==document.getElementById(div)){ return false } t=t.parentNode } return true } function refreshTopBar(recursive) { $.ajax({ url: "/commons/topBar/", success: function(data){ $("#topBar").html(data); }}); if(recursive) setTimeout("refreshTopBar();",300000); } function refreshMyRebis(type,section) { //if(type == "section") $.ajax({ url: "/commons/refreshMyResult/section:" + section, success: function(data){ $("#slidercontainer #showMyResultLabel").html(data); }}); /*if(type == "query") $.ajax({ url: "/commons/refreshMyQuery/section:" + section, success: function(data){ $("#slidercontainer #showMyQueryLabel").html(data); }}); */ } function collectGridParams(gridname) { var gridurl = ""; if(typeof(themapname)!='undefined' && typeof(eval(themapname))!='undefined' && gridname!='undefined' && (currentTab=='mapView' || gridname=='rmap')) { //alert("1"); gridurl = eval(themapname).dataurl; var matches1 = gridurl.match(/([a-zA-Z0-9_]*[a-zA-Z0-9_\-]*:[^(?:\/|\?)]*)/g); var matches2 = gridurl.match(/([a-zA-Z0-9_]*[a-zA-Z0-9_\-\[\]]*=[^&]*)/g); return new Array(matches1,matches2); } else if($("#gbox_"+gridname+"").is('*')) { //alert("0"); gridurl = $("#"+gridname+"").getGridParam('url'); var matches1 = gridurl.match(/([a-zA-Z0-9_]*[a-zA-Z0-9_\-]*:[^(?:\/|\?)]*)/g); var matches2 = gridurl.match(/([a-zA-Z0-9_]*[a-zA-Z0-9_\-\[\]]*=[^&]*)/g); return new Array(matches1,matches2); } //alert("2"); return false; } function initFromGrid(gridname,formname,forbasicfilters) { var matches = collectGridParams(gridname); if(forbasicfilters) { gridname=gridname.replace(/grid/g,''); } for(var i=0; matches[1]!=null && i" + obj.innerHTML + ""); } obj.style.visibility = "hidden"; obj.style.position = "absolute"; } function basicLinkClick(obj,field,id,listurl,formname,gridname, donotloadgrid) { activateBasicLink(obj,field,id,formname); formparams = basicform + advancedform; var searchParams = new Array(); var matches1 = basicform.match(/([a-zA-Z0-9_]*[a-zA-Z0-9_\-]*:[^(?:\/|\?)]*)/g); var matches2 = basicform.match(/([a-zA-Z0-9_]*[a-zA-Z0-9_\-\[\]]*=[^&]*)/g); formparamsurl = "?"; formparamsdata = "/"; for(var i=0; matches2!=null && i 0) { $('#' + gridname).setGridParam({url:(listurl + formparamsdata + formparamsurl + searchform).replace(/\?\?/,"?"),page: "1",rowNum:$('#brows').val()}).trigger('reloadGrid'); } else { $('#searchForm').attr('href','/' + $('#searchIn').val() + '/index/' + (formparamsdata + formparamsurl + searchform).replace(/\?\?/,"?")); $('#searchForm').focus(); } initFromGrid(gridname); } function toggleBasicFilter() { $("#toggleBasicFilter").toggle( function () { $("#showImg").attr("src","http://static2.reidin.com/img/collapse_down.png"); $("#basicFilterSection").addClass("phaseout"); $("#toggleBasicFilter").html("Show Quick Filters "); }, function() { $("#showImg").attr("src","http://static2.reidin.com/img/collapse_up.png"); $("#basicFilterSection").removeClass("phaseout"); $("#toggleBasicFilter").html("Hide Quick Filters "); } ); } function detailQuery(gridname,queryfield,fieldname,queryvalue,controllername,listlink,country) { if($("#" + gridname).length>0) { $("#" + gridname).setGridParam({url:'/'+controllername+'/'+listlink+'/?CountryID='+country+'&' + fieldname + "=" + queryvalue }).trigger("reloadGrid"); $("#" + queryfield).selectOptions(queryvalue); $.fn.fancybox.close(); } else { $('#searchForm').attr('href','/'+controllername+'/index/?CountryID='+country+'&' + fieldname + "=" + queryvalue); $('#searchForm').focus(); } return false; } function printArticle() { if (window.print) { setTimeout('window.print();',200); } else if (agt.indexOf("mac") != -1) { alert("Press 'Cmd+p' to print."); } else { alert("Press 'Cmd+p' to print."); } } var SelectedCityID = ''; function fancyClick(obj,linkNameObject) { obj.href = obj.href + "&ajax=1"; setTimeout("fixFancyLink();",5000); if(getCookie("fancyLink")) { fancyLink = getCookie("fancyLink"); fancyLink = fancyLink.split(","); } if(getCookie("fancyLinkName")) { fancyLinkName = getCookie("fancyLinkName"); fancyLinkName = fancyLinkName.split("|"); } if(getCookie("fancyLinkTime")) { fancyLinkTime = getCookie("fancyLinkTime"); fancyLinkTime = fancyLinkTime.split(","); } if(getCookie("fancyLinkCount")) { fancyLinkCount = getCookie("fancyLinkCount"); fancyLinkCount = fancyLinkCount.split(","); } fancyLink.push(obj.href); if(typeof(linkNameObject)=='object') { fancyLinkName.push(stripHTML($(linkNameObject).html())); } else { fancyLinkName.push(stripHTML(obj.innerHTML)); } fancyLinkTime.push(now()); fancyLinkCount=fancyLink.length; if(fancyLinkCount>10) { minus = (fancyLinkCount - 10); fancyLink.splice(0,minus); fancyLinkName.splice(0,minus); fancyLinkTime.splice(0,minus); fancyLinkCount=fancyLink.length; } else minus = 0; setCookie("fancyLink",fancyLink,1); setCookie("fancyLinkName",fancyLinkName.join("|"),1); setCookie("fancyLinkTime",fancyLinkTime,1); setCookie("fancyLinkCount",fancyLinkCount,1); $("#fancyHistory").html(""); var j=0; for(i=fancyLinkCount;i>=minus;i--) { if(fancyLinkName[i]) $("#fancyHistory").html($("#fancyHistory").html() + "" + "[" + fancyLinkTime[i] + "] " + fancyLinkName[i] + "
"); j++; } for(i=0;i<10-j;i++) { $("#fancyHistory").html($("#fancyHistory").html() + "
"); } $("#currentLink").attr("href",$("#currentLink").attr("href").replace(/\?ref=(.*?)&product/,"?ref=" + obj.href + "&product")) return false; } function fixFancyLink() { fancyobjarr = $("a.fancypopup"); for(i=0;ifancyLinkCount-1 && fancyLinkCount>=2) { $('#backLink').attr('href', fancyLink[fancyLinkCount-2]); $('#backLink').click(); fancyLinkCount=fancyLinkCount - 1; } return false; } function forwardButton() { if(fancyLink.length>=fancyLinkCount+1) { $('#backLink').attr('href', fancyLink[fancyLinkCount]); $('#backLink').click(); fancyLinkCount=fancyLinkCount + 1; } return false; } function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop; } while (obj = obj.offsetParent); } return [curleft,curtop]; } function now() { var currentTime = new Date(); var month = currentTime.getMonth() + 1; var day = currentTime.getDate(); var year = currentTime.getFullYear(); var hours = currentTime.getHours(); var minutes = currentTime.getMinutes(); var months = new Array(); months[1] = "Jan"; months[2] = "Feb"; months[3] = "Mar"; months[4] = "Apr"; months[5] = "May"; months[6] = "Jun"; months[7] = "Jul"; months[8] = "Aug"; months[9] = "Sep"; months[10] = "Oct"; months[11] = "Nov"; months[12] = "Dec"; if (minutes < 10){ minutes = "0" + minutes } year = "" + year; return day + "-" + months[month] + "-" + year.substr(2) + " " + hours + ":" + minutes; } function checkGoogleMapsTileServer(successAction, failedAction) { } function selectFont() { $(".fontSelectors").css("background-color","").css("color",""); $("#font" + getCookie("fontSize")).css("background-color","#003366").css("color","#FFFFFF"); } function addToSearch(xmlfile){ if(($.browser.mozilla && parseInt($.browser.version)>=1) || ($.browser.msie && parseInt($.browser.version)>=7)){ window.external.AddSearchProvider(xmlfile); } else{ document.getElementById('alertdiv').style.display='block'; //alert("Sorry. This feature is supported by Firefox 2.0/I.E 7.0 and later versions If you want to benefit from this feature please upgrade your browser."); } } function addToMyREBIS(grid,section,isitmap) { if(section == "data") { checkedItems = getTreeCheckedItems().toString(); data = "data[MyRecord][Section]="+section+"&data[MyRecord][MySection2]="+checkedItems+"&data[MyRecord][MySectionBaseLink]=/tree/listTree&data[MyRecord][MySectionID]=&data[MyRecord][MySectionName]=MyREBIS&data[MyRecord][GridOption]=1"; if(checkedItems.split(',').length<1) { showInfoBar('You have to select at least 1 data',"error"); return false; } else { $.ajax({ type: "POST", url: "/my_rebis/my_section_save/", data:data, success: function(data) { refreshMyRebis("query",section); if(section == "ips") section == "Information Partner(s)"; else if (section == "researches") section == "Report(s)"; else if(section == "Pubs") section = "Publications"; showInfoBar(section + ' successfully saved to MyREBIS.',"info"); } }); } } else { if(!isitmap) { data = "data[MyRecord][Section]="+section+"&data[MyRecord][MySection2]="+$('#' + grid).getGridParam('selarrrow')+"&data[MyRecord][MySectionBaseLink]="+urlEncode($('#'+grid).getGridParam('url'))+"&data[MyRecord][MySectionID]=&data[MyRecord][MySectionName]=MyREBIS&data[MyRecord][GridOption]=1"; if ($('#'+grid).getGridParam('selarrrow').length<1) { showInfoBar('You have to select at least 1 '+grid.replace(/grid/,"")+'.',"error"); return false; } else { $.ajax({ type: "POST", url: "/my_rebis/my_section_save/", data:data, success: function(data) { refreshMyRebis("query",section); if(section == "ips") section == "Information Partner(s)"; else if (section == "researches") section == "Report(s)"; else if(section == "Pubs") section = "Publications"; showInfoBar(section + " successfully saved to MyREBIS.","info"); } }); } } else { kmldata = eval(themapname).collectKml(); kmldata = kmldata.replace(/"/g,"'"); kmldata = kmldata.replace(/\n/g,"#nl#"); data = "data[MyRecord][Section]="+section+"&data[MyRecord][MySection2]="+urlEncode(kmldata)+"&data[MyRecord][MySectionBaseLink]="+eval(themapname).dataurl+"&data[MyRecord][MySectionID]=&data[MyRecord][MySectionName]=MyREBIS&data[MyRecord][GridOption]=1&data[MyRecord][IsItMap]=1"; if (kmldata.length<1) { showInfoBar('You have to select at least 1 '+grid.replace(/grid/,"")+'.',"error"); return false; } else { $.ajax({ type: "POST", url: "/my_rebis/my_section_save/", data:data, success: function(data) { refreshMyRebis("query",section); } }); } } } $('.myRebisSaveMenu').addClass('phaseout'); return false; } function addToMyREBIS2(section,id,baselink) { data = "data[MyRecord][Section]="+section+"&data[MyRecord][MySection2]="+id+"&data[MyRecord][MySectionBaseLink]="+baselink+"&data[MyRecord][MySectionID]=&data[MyRecord][MySectionName]=MyREBIS&data[MyRecord][GridOption]=1"; $.ajax({ type: "POST", url: "/my_rebis/my_section_save/", data:data, success: function(data) { refreshMyRebis("query",section); if(section == "ips") section == "Information Partner(s)"; else if (section == "researches") section == "Report(s)"; else if(section == "Pubs") section = "Publications"; showInfoBar(section + ' successfully saved to MyREBIS.',"info","messageContainerDetail"); } }); return false; } function urlEncode( s ) { return encodeURIComponent( s ).replace( /\%20/g, '+' ).replace( /!/g, '%21' ).replace( /'/g, '%27' ).replace( /\(/g, '%28' ).replace( /\)/g, '%29' ).replace( /\*/g, '%2A' ).replace( /\~/g, '%7E' ); } function urlDecode( s ) { return decodeURIComponent( s.replace( /\+/g, '%20' ).replace( /\%21/g, '!' ).replace( /\%27/g, "'" ).replace( /\%28/g, '(' ).replace( /\%29/g, ')' ).replace( /\%2A/g, '*' ).replace( /\%7E/g, '~' ) ); } function checkemail(e) { var seenAt = false; for(var j = 0; j < e.value.length; j++) { var c = e.value.charAt(j); if ((c == ' ') || (c == '\n') || (c == '\t')) { return false; } if ((c == '@') && (seenAt == true)) { return false; } if ((c == '@')) seenAt = true; } if (seenAt == false) { return false; } return true; } function isblank(e) { if (e.value == null || e.value == "") return true; for(var i = 0; i < e.value.length; i++) { var c = e.value.charAt(i); if ((c != ' ') && (c != '\n') && (c != '\t')) return false; } return true; } function jqgridStart(grid) { var viewDiv = $("#gbox_" + grid + "grid").parent().parent().parent().parent().parent().attr("id"); if(viewDiv == "") viewDiv = $("#gbox_" + grid + "grid").parent().parent().parent().parent().parent().parent().attr("id"); if(viewDiv == "") viewDiv = $("#gbox_" + grid + "grid").parent().parent().parent().parent().parent().parent().parent().attr("id"); var detail = 0; if(!viewDiv.match(/Inner/)) viewDiv = viewDiv + "Inner"; clientLog(grid + ":BeforeLoad"); $("#modal_grid_overlay").css('display',''); $("#" + grid + "gridpagerInfo").html(""); $("#" + viewDiv).customFadeIn(1); $("#" + viewDiv).removeClass("phaseout"); }