﻿/* 
* Contact area management
* Copyright 2010, FHNW 
* Released under the MIT, BSD, and GPL Licenses.
* 
*/

$(document).ready(function () {
    var data = $('#data_fhnw').html();
    if (data != null) {
        var s = $('#priv_adrtel').html();
        s = s.replace(/<\/?([b-z]+)[^>]*>/gi, '');
        s = s.replace(/^\s*|\s*$/g, '');
        var l = s.length;
        if (l > 0) {
            $("#head_fhnw").attr('class', 'selected');
            $("#head_priv").removeAttr('class');
            $("#head_priv").attr('href', 'javascript:ShowPrivAddr()');
        }
        else {
            $("#head_fhnw").hide();
            $("#head_separator").hide();
            $("#head_priv").hide();
        }
    }
});

function ShowPrivAddr() {
    $("#head_fhnw").removeAttr('class');
    $("#head_fhnw").attr('href', 'javascript:ShowFHNWAddr();');
    $("#head_priv").attr('class', 'selected');
    $("#head_priv").removeAttr('href');
    $('#data_fhnw').hide();
    $('#data_priv').show();
}

function ShowFHNWAddr() {
    $("#head_fhnw").attr('class', 'selected');
    $("#head_fhnw").removeAttr('href');
    $("#head_priv").removeAttr('class');
    $("#head_priv").attr('href', 'javascript:ShowPrivAddr();');
    $('#data_priv').hide();
    $('#data_fhnw').show();
}




