function findObject(objectId) { if(window.document.getElementById && window.document.getElementById(objectId)) return window.document.getElementById(objectId); else if (window.document.all && window.document.all(objectId)) return window.document.all(objectId); else if (window.document.layers && window.document.layers[objectId]) return window.document.layers[objectId]; else return null; } function changeDisplay(oName,oDisp ) { if (typeof(findObject)=='function') { var theDiv = findObject(oName); if( !theDiv ) { return; } if( theDiv.style ) { theDiv = theDiv.style; } if( typeof( oDisp ) == 'string' ) { oDisp = oDisp.toLowerCase(); theDiv.display = ( oDisp == 'none' ) ? 'none' : ( oDisp == 'block' ) ? 'block' : ( oDisp == 'inline' ) ? 'inline' : ''; } else { if (typeof(theDiv.display) != 'undefined') { if (theDiv.display.toLowerCase() == 'block') theDiv.display = 'none'; else theDiv.display = 'block'; } } return theDiv.display == 'block'; } return false; } function selectInput(item) { try { if (item != null && item.value != '') { item.select(); item.focus(); } } catch(e) {} } function Bookmark() { if (navigator.userAgent.indexOf('MSIE') > 0) { var sTitle = arguments[0] ? arguments[0] : 'Omroep Brabant'; var sHref = arguments[1] ? arguments[1] : ''; window.external.AddFavorite('http://www.omroepbrabant.nl/' + sHref, sTitle); } else alert('Het automatisch toevoegen van deze pagina aan je favorieten wordt alleen door Internet Explorer ondersteund.'); } function loadPopup(sHref, sWidth, sHeight) { var LeftPosition=(screen.width)?(screen.width-sWidth)/2:100; var TopPosition=(screen.height)?(screen.height-sHeight)/2:100; var settings='width='+sWidth+',height='+sHeight+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; var theWindow = window.open(sHref, '_blank', settings); if (theWindow != null) theWindow.focus(); return theWindow; } function ToggleEditComment(objId, bDisplay) { changeDisplay('ctrl_' + objId, (bDisplay) ? 'none' : ''); changeDisplay('body_' + objId, (bDisplay) ? 'none' : ''); changeDisplay('edit_' + objId, (bDisplay) ?'block' : 'none'); changeDisplay('editctrl_' + objId, (bDisplay) ? 'block' : 'none'); return false; } function ScrollToTopicComments() { try { var _objTopicComments = findObject('topiccomments'); var yPosition = 0; if (_objTopicComments != null) { if (document.layers) { yPosition = _objTopicComments.y; } else if (document.getElementById) { yPosition = _objTopicComments.offsetTop; } } if (yPosition > 20) { window.scrollTo(0, yPosition - 20); } } catch(e) { } } function addLoadListener(fn) { if (typeof window.addEventListener != 'undefined') { window.addEventListener('load', fn, false); } else if (typeof document.addEventListener != 'undefined') { document.addEventListener('load', fn, false); } else if (typeof window.attachEvent != 'undefined') { window.attachEvent('onload', fn); } else { var oldfn = window.onload; if (typeof window.onload != 'function') { window.onload = fn; } else { window.onload = function() { oldfn(); fn(); }; } } } var _bannerViews = new Array(); function AddBannerView(bannerid) { _bannerViews.push(bannerid); } function increaseBannerViews() { try { if (_bannerViews.length > 0) { PageMethods.IncreaseBannerCounters(_bannerViews, function(response) { }); } } catch(e) { } } addLoadListener(increaseBannerViews); function onHeaderClickDelegate(objectid) { if (objectid != null) { var iObjectId = parseInt(objectid); if (!isNaN(iObjectId)) { PageMethods.IncreaseCampagneCounter(iObjectId, function(response) { }); } } } var _externalPlugins = new Array(); function AddExternalPlugin(sPlugin) { _externalPlugins.push(sPlugin); } function loadExternalPlugins() { try { if (_externalPlugins.length > 0) { for (var i=0; i < _externalPlugins.length; i++) { PageMethods.LoadExternalPlugin(_externalPlugins[i], function(response) { try { if (response != null && response[1] != null) { var phDiv = findObject(response[0]); if (phDiv != null) { phDiv.innerHTML = response[1]; } } } catch(e) { } }); } } } catch(e) { } } addLoadListener(loadExternalPlugins); function showLivePlayer(sMode) { if (typeof(loadPopup) == 'function') { loadPopup('./Live.aspx?mode=' + sMode, 620, 400); } else { window.open('./Live.aspx?mode=' + sMode, '_blank'); } } function openWithAction(sUrl, sAction) { try { window.open(sUrl + '&action=' + sAction, '_self'); return false; } catch(e) { return true; } } function socialMediaLink(sType, sTitle, sUrl) { var sHref = ''; var sWidth = '600'; var sHeight = '400'; if (sType == 'facebook') { sHref = 'http://www.facebook.com/sharer.php?u=' + sUrl + '&t=' + sTitle; sWidth = '626'; sHeight = '436'; } else if (sType == 'hyves') { sHref = 'http://www.hyves.nl/hyvesconnect/smartbutton?title=' + sTitle + '&body=' + sUrl.replace(/%20/gi, "_") + '&category=12&type=11'; sWidth = '550'; sHeight = '600'; } if (sHref != '') { baseTracker._trackPageview('/socialbookmark/' + sType); loadPopup(sHref, sWidth, sHeight); return false; } else { return true; } }