if (self.innerWidth) {
	frameWidth = self.innerWidth;
	frameHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientWidth) {
	frameWidth = document.documentElement.clientWidth;
	frameHeight = document.documentElement.clientHeight;
} else if (document.body) {
	frameWidth = document.body.clientWidth;
	frameHeight = document.body.clientHeight;
} else {
	frameWidth = null;
	frameHeight = null
}

// ini
var _POPUP_FEATURES = '';

// popup
function rawPopup(url,target,features){
    if(typeof(features) == 'undefined')
        features = _POPUP_FEATURES;
    if(typeof(target) == 'undefined')
        target = '_blank';
    var popup = window.open(url,target,features);
    if (popup) {
        popup.focus();
        return popup;
    };
    return false;
}

// sur chargement...
$(document).ready(
    function(){
        // ie5.5+ png
        //$('img[@src$=.png],.fondpng').pngfix();
        // popup
        $('a.externe').click(
            function(){
                if (rawPopup($(this).attr('href'),'_blank')) {
                    return false;
                };
                return true;
            }
        );
        // safeAddress
        $('span.safeAddress').each(
            function(){
                var title = $(this).attr('title');
                var mail = $(this).text();
                $(this).empty();
                $(this).append('<a href="mailto:' + mail + '">' + title + '</a>');
                $(this).removeAttr('title');
                $(this).removeAttr('class');
            }
        );
    }
);
