function rwdredirectcal(EmbedCalEvent, DateofToday){ top.location.href=window.location.href.split('?')[0] + "?Templates=RWD&object=" + EmbedCalEvent + "&infobar=no&ConfPosition=2&Date="+ DateofToday + '&VD=' + DateofToday; return false; } function rwdprint(obj) { URL=obj; var pwidth=500; var pheight=560; var left = ( screen.width - pwidth ) / 2; var top = ( screen.height - pheight ) / 2; window.open(URL,'','width='+pwidth+',height='+pheight+',scrollbars=yes,toolbars=no,left='+left+',top='+top); return false; } function rwd_cal_print(obj, w, h){ URL=obj; var pwidth=w; var pheight=h; var left = ( screen.width - pwidth ) / 2; var top = ( screen.height - pheight ) / 2; window.open(URL,'','width='+pwidth+',height='+pheight+',scrollbars=yes,toolbars=no,left='+left+',top='+top); return false; } /** vvv **/ var bustcachevar=1; //bust potential caching of external pages after initial request? (1=yes, 0=no) var loadedobjects=""; var rootdomain="http://"+window.location.hostname; //var bustcacheparameter=""; function GetAnotherCal(url, containerid){ var page_request = false; if (window.XMLHttpRequest) // if Mozilla, Safari etc page_request = new XMLHttpRequest(); else if (window.ActiveXObject){ // if IE try { page_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e){ try{ page_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){} } } else return false page_request.onreadystatechange=function(){ loadpage(page_request, containerid) } //if (bustcachevar) //if bust caching of external page //bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime(); //page_request.open('GET', url+bustcacheparameter, true); page_request.open('GET', url, true); page_request.send(null); } function loadpage(page_request, containerid){ if (page_request.readyState == 4 && page_request.status==200) document.getElementById(containerid).innerHTML=page_request.responseText; } function loadobjs(){ if (!document.getElementById) return for (i=0; i0){ for (i=1;i<=MaxImgNum;i++){ theimgid='graImg'+i; captionid='graImgCap'+i; if (theimgid==null || !document.getElementById(theimgid)){continue;} imgwidth = document.getElementById(theimgid).width; imgheight = document.getElementById(theimgid).height; if (changeto=='smaller'){ imgwidth = eval(imgwidth*2/3); imgheight = eval(imgheight*2/3); document.getElementById(captionid).style.fontSize=eval(fontsizeto*2/3) + 'px'; } if (changeto=='larger'){ imgwidth = eval(imgwidth*3/2); imgheight = eval(imgheight*3/2); document.getElementById(captionid).style.fontSize=fontsizeto + 'px'; } document.getElementById(theimgid).style.width = imgwidth + "px"; document.getElementById(theimgid).style.height = imgheight + "px"; } } } function show_hide_toggle(id, status){ // added at 2009.2.5 // status has to be a string either "none" or "block" // show_hide_toggle("cellid", "none") // id is the id of the object document.getElementById(id).style.display=status; } function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //function silentErrorHandler() {return true;} //window.onerror=silentErrorHandler; function load2rwdpart(resultid, url){ $(document).ready(function() { $.ajaxSetup ({ cache: false }); $(resultid).load(url) }); } function get_browser_dimention(){ var myWidth; var myHeight; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return {browserwidth:myWidth, browserheight:myHeight}; } /* vvvvvvvvvvvvvvv*/ /* get the parameter value based on the key. If rurlStr is emptry, it parses the browser url value */ function RWDParseQuerystring(rurlStr, key, default_){ if (default_==null) default_=""; key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); if (rurlStr=="") rurlStr=window.location.href; var qs = regex.exec(rurlStr); if(qs == null) return default_; else return qs[1]; } function Parse_cust_para(sURLstr, sParam){ /* parse a URL Query like string to get the value 1. Used in f_portal.inc to get cust_parameter for panel_bgi and panel_bgc */ if (typeof(sURLstr) == 'undefined' || sURLstr.length==0) return ''; var sURLVariables = sURLstr.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) { return sParameterName[1]; } } return ''; } function GetURLParameter(sURLstr, sParam) { /* Parse a URL-like string to get the parameters */ /* Examples: var cell_id = GetURLParameter('http://www.myserver.com/?cell_id=mu001&config=configfile', 'cell_id'); var config = GetURLParameter('http://www.myserver.com/?cell_id=mu001&config=configfile', 'config'); */ /* var sPageURL = window.location.search.substring(1); */ sPageURL = sURLstr.split('?')[1]; if (typeof(sPageURL) == 'undefined') return ''; var sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) { return sParameterName[1]; } } return ''; } /* vvvvvvvvvvvvvvv*/ /* Call jPList3 to generate the panel */ /* ismashup=0: open on rwdbodypart; ismashup=1: open in a mashup top/bottom panel; ismashup=2: open in a mashup middle panel*/ function calljplist3(RWDurl, loadtoid, prefix, ismashup){ RWDurl=RWDurl.replace(" ", "%20"); if (GetURLParameter(RWDurl, 'pagetitle').length >0){ $('span.HeaderTitle').text(decodeURIComponent(GetURLParameter(RWDurl, 'pagetitle'))); } if (!document.getElementById(loadtoid)) { loadtoid='rwdbodypart'; } /* if loadtoid=rwd-mashup not exist. Fall back to rwdbodypart */ $("#" + loadtoid).load(RWDurl, function(){ $("#" + prefix + "PList").jplist({ items_box: "." + prefix + "-tbl" ,item_path: "." + prefix +"tbl-item" ,panel_path: '.panel' ,no_results: ".jplist-no-results" ,cookies: false ,expiration: -1 //animate to top ,animate_to_top: ismashup==0?'html body':'' //'auto' - top panel; '' - disable animate to top; ,animate_to_top_duration: 1000 //events ,ask_event: 'jplist_ask' //event from panel to controller: ask to rebuild item container's html ,answer_event: 'jplist_answer' //event from controller to panel after html rebuild ,force_ask_event: 'jplist_force_ask' //event to panel -> panel sends ask event ,restore_event: 'jplist_restore' //event to panel -> restore panel from event data (statuses array) ,status_event: 'jplist_status' //event to panel -> get all statuses and merge them with the given status, then send ask event //panel controls ,control_types: { 'drop-down':{ class_name: 'control_dropdown' ,options: {} } ,'placeholder':{ class_name: 'control_placeholder' ,options: { //paging paging_length: 3 //arrows ,prev_arrow: '<' ,next_arrow: '>' ,first_arrow: '<<' ,last_arrow: '>>' } } ,'label':{ class_name: 'control_label' ,options: {} } ,'textbox':{ class_name: 'control_textbox' ,options: { ignore: '[~!@#$%^&*\(\)+=`\'"\/\\_]+' //regular expression: characters to ignore } } //views ,control_types: { 'views': { class_name: 'control_views' ,options: {} } } } ,redraw_callback: function(sort, items_on_page, current_page, order, sort_type){ items_box="." + prefix + "-tbl"; item_path="." + prefix +"tbl-item"; var row_list = eval('$(".' + prefix + 'tbl-item")'); var row; for(var i=0; i 0 ){ $("#" + loadtoid + " .cldesc").each(function(i){ len=$(this).text().length; if(len > eval('previewlimit_' + prefix)){ $(this).text($(this).text().substr(0, eval('previewlimit_' + prefix))); } }); } } }) // end of .jplist items_wrapper="#" + prefix + "PList";items_box="." + prefix + "-tbl"; item_path="." + prefix +"tbl-item"; if ($(items_wrapper + " " + items_box + " " + item_path + " .desc").length==0 || $(items_wrapper + " " + items_box + " " + item_path + " .desc").html().length==0 || $(items_wrapper + " " + items_box + " " + item_path + " .mb2fcbp").length>0) { $(items_wrapper + " .filter .mb2_include_filter_by_preview").hide(); $(items_wrapper + " .filter div.placeholder").hide(); $(items_wrapper + " div li.ddspaz").hide(); $(items_wrapper + " div li.ddspza").hide(); } if ($(items_wrapper + " " + items_box + " " + item_path + " .title").length==0 || $(items_wrapper + " " + items_box + " " + item_path + " .title").html().length==0) { $(items_wrapper + " .filter .mb2_include_filter_by_title").hide(); $(items_wrapper + " .filter div.placeholder").hide(); $(items_wrapper + " div li.ddstaz").hide(); $(items_wrapper + " div li.ddstza").hide(); } if ($(items_wrapper + " " + items_box + " " + item_path + " .date").length==0 || $(items_wrapper + " " + items_box + " " + item_path + " .date").html().length==0) { $(items_wrapper + " div li.ddsda").hide(); $(items_wrapper + " div li.ddsdd").hide(); } }) //end of .load } // end of calljplist /* vvvvvvvvvvvvvvv*/ /* Call jPList to generate the panel */ /* ismashup=0: open on rwdbodypart; ismashup=1: open in a mashup top/bottom panel; ismashup=2: open in a mashup middle panel*/ function calljplist(RWDurl, loadtoid, prefix, ismashup){ RWDurl=RWDurl.replace(" ", "%20"); if (GetURLParameter(RWDurl, 'pagetitle').length >0){ $('span.HeaderTitle').text(decodeURIComponent(GetURLParameter(RWDurl, 'pagetitle'))); } if (!document.getElementById(loadtoid)) { loadtoid='rwdbodypart'; } /* if loadtoid=rwd-mashup not exist. Fall back to rwdbodypart */ $("#" + loadtoid).load(RWDurl, function(){ $("#" + prefix + "PList").jplist({ itemsBox: ".list" ,itemPath: ".list-item" ,panelPath: '.jplist-panel' }) // end of jplist }) //end of .load } // end of calljplist /* headerlinks bar */ $(document).ready(function() { function toggleNavbarMethod() { if ($(window).width() > 768) { $('.navbar .dropdown').on('mouseover', function(){ $('.dropdown-toggle', this).trigger('click'); }).on('mouseout', function(){ $('.dropdown-toggle', this).trigger('click').blur(); }); } else { $('.navbar .dropdown').off('mouseover').off('mouseout'); } } // toggle navbar hover toggleNavbarMethod(); // bind resize event $(window).resize(toggleNavbarMethod); });