
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - ++resource++edubs.theme.scipts/setHeight100.js - */
function resizeContent() {
    var node = jq('body')[0];
    var bodyHeight = (node.offsetHeight);
    var windowsize = jq.viewportHeight();
    
    var diffSize = (windowsize-bodyHeight);

    contentEl = jq('#portal-column-content')[0];
    contentElSize = contentEl.offsetHeight;
    jq(contentEl).css({height:contentElSize+diffSize});

};

jq.viewportHeight = function() {
     return self.innerHeight ||
        jq.boxModel && document.documentElement.clientHeight ||
        document.body.clientHeight;
};

jq(resizeContent);


/* - mark_special_links.js - */
// http://www.agsbs.ch/portal_javascripts/mark_special_links.js?original=1
function scanforlinks(){if(typeof external_links_open_new_window=='string')
var elonw=external_links_open_new_window.toLowerCase()=='true';else elonw=false;var url=window.location.protocol+'//'+window.location.host;if(elonw)
jq('a[href^=http]:not(.link-plain):not([href^='+url+'])').attr('target','_blank');var protocols=/^(mailto|ftp|news|irc|h323|sip|callto|https|feed|webcal)/;var contentarea=jq(getContentArea());contentarea.find('a[href^=http]:not(.link-plain):not([href^='+url+']):not(:has(img))').wrap('<span>').parent().addClass('link-external')
contentarea.find('a[href]:not([href^=http]):not(.link-plain):not([href^='+url+']):not(:has(img))').each(function(){if(res=protocols.exec(this.href))
jq(this).wrap('<span>').parent().addClass('link-',res[0])})};jq(scanforlinks);

/* - ++resource++edubs_website_resources/edubs_website.js - */
// http://www.agsbs.ch/portal_javascripts/++resource++edubs_website_resources/edubs_website.js?original=1
function bindLinkClickEvents(){var external=jq('#archetypes-fieldname-externalLink');var internal=jq('#archetypes-fieldname-internalLink');internal.css('display','none');external.css('display','none');if(jq('#typeOfLink_1').attr('checked')==true){internal.css('display','block');external.css('display','none')}
else if(jq('#typeOfLink_2').attr('checked')==true){internal.css('display','none');external.css('display','block')}
jq('#typeOfLink_1').bind('click',function(e){internal.css('display','block');external.css('display','none')});jq('#typeOfLink_2').bind('click',function(e){internal.css('display','none');external.css('display','block')});jq('#typeOfLink_3').bind('click',function(e){external.hide();internal.hide()})}
jq(bindLinkClickEvents);
