
/* 
 * Loads the stylesheet for MSIE.
 */
function applyCSSFixes()
{
    if ( document.createElement &&
         (navigator.appVersion.indexOf('Mac') != -1 || navigator.appName == 'Microsoft Internet Explorer' ||
          navigator.appVersion.indexOf('Safari') != -1 ))
    {
        var css = document.createElement('link');
        
        if (navigator.appVersion.indexOf('Safari') != -1) {
            css.setAttribute('href','/sites/all/themes/truth/fixes_safari.css');
        }
        else if (navigator.appVersion.indexOf('Mac') != -1) {
            css.setAttribute('href','/sites/all/themes/truth/fixes_macos.css');
        }
        else if (navigator.appName == 'Microsoft Internet Explorer') {
            css.setAttribute('href','/sites/all/themes/truth/fixes_msie.css');
        }
        css.setAttribute('rel','stylesheet');
        css.setAttribute('type','text/css');

        document.getElementsByTagName("head")[0].appendChild(css);
    }
}
applyCSSFixes();

function clearInputBox (id)
{
    if (document.getElementById && document.createElement) {
        document.getElementById(id).value = "";
    }
}

var biro_currentTextSize = 0;
function changeTextSize (updown)
{
	biro_currentTextSize = Math.max(Math.min((biro_currentTextSize + updown),1),-1);
    if (document.getElementById && document.createElement)
    {
        styleObj = document.getElementById('articles').style;
        switch (biro_currentTextSize) {
            case 1: 
//                alert(styleObj.fontSize);
                styleObj.fontSize = "1.3em"; break;
            case 0:
            	styleObj.fontSize = "1em"; break;
            case -1: 
                styleObj.fontSize = "0.9em"; break;
        }
    }
}

/* IE6 background image flicker bug fix */
try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}

/* ff3 style fix */
$(function(){
	if(navigator.userAgent.match(/firefox\/3\.\d/i))
		$('#edit-search-block-form-keys').css('top', '-6px');
});
