Cufon.replace("h1, h2, h3");

var isIE6 = ((navigator.userAgent.indexOf("MSIE 6.") != -1) && (navigator.userAgent.indexOf("Opera") == -1));

jQuery(function($) {
    var scrollContainer = $("#article_detail #content_container, #faq #content_container").jScrollPane({
		 showArrows:true, 
		 arrowSize: 15,
		 scrollbarWidth: 18
    });
    
    if(isIE6 && $(scrollContainer).find('.jScrollPaneTrack').length < 1) {
    	$(scrollContainer).css('margin-left', '12px');
    };
});

function refreshToWindow(refresh_to) {
    window.location.href = refresh_to;
}

function ask_question()
{
    window.open('http://www.usmedia.nl');
}

function openHairSelector(get_refresh, open_step)
{
    tb_show(null, 'flash_hairSelector.php?width=740&height=390&open_step='+open_step+'&get_refresh='+get_refresh, false);
}

function openCouponOverlay() {
    tb_show(null, 'flash_coupon.php?width=550&height=520', false);
}

function expandLinks(divid)
{
    if ( this.document.getElementById(divid).style.visibility='hidden') {
        this.document.getElementById(divid).style.visibility='visible';
    } else {
        this.document.getElementById(divid).style.visibility='hidden';
    }
}

function openPopup(url, winname, width, height, scrollbar) {

    var screenX = screen.width;
    var screenY = screen.height;

    var popupWidth  = width;
    var popupHeight = height;

    var popupLeft = parseInt((screenX - popupWidth)  / 2);
    var popupTop  = parseInt((screenY - popupHeight) / 2);

    win = window.open(url,winname, "width=" + width +", height=" + height + ", top=" + popupTop + ", left=" + popupLeft + ",scrollbars = " +scrollbar+",resizable" );
    if (parseInt(navigator.appVersion) >= 4) {
        win.window.focus();
    }
}

function noah(PID)
{
    googleTrackPageview(PID);
}

function noahFlash(PID)
{
    googleTrackPageview(PID);
}

function teller(PID)
{
    googleTrackPageview(PID);
}

var so_array = new Array();

function collex(cid)
{
    if (document.getElementById('collapsed'+cid).className == 'collapsed') {
        document.getElementById('collapsed'+cid).className = 'expanded';
        document.getElementById('meerlink'+cid).innerHTML = 'Minder...';
    } else {
        document.getElementById('collapsed'+cid).className = 'collapsed';
        document.getElementById('meerlink'+cid).innerHTML = 'Meer...';
    }

    return false;
}

function newWindow(url, winname, width, height, scrollbar) {

    var screenX = screen.width;
    var screenY = screen.height;

    var popupWidth  = width;
    var popupHeight = height;

    var popupLeft = parseInt((screenX - popupWidth)  / 2);
    var popupTop  = parseInt((screenY - popupHeight) / 2);

    var win = window.open(url,winname, "width=" + width +", height=" + height + ", top=" + popupTop + ", left=" + popupLeft + ",scrollbars = " +scrollbar+",resizable" );
    if (parseInt(navigator.appVersion) >= 4) {
        win.window.focus();
    }
}