///
/// jQuery functions
///



///
/// FAQ Sliding Function
///

$(document).ready(function(){

/*
$('li.question h4').click(function () {
	if ($("div.answer", $(this).parent()).is(":hidden")) {$("div.answer", $(this).parent()).show();
	}
	else {$("div.answer", $(this).parent()).hide();
	}

	if ($("div.answer", $(this).parent()).is(":hidden")) {$("div.answer", $(this).parent()).slideDown("fast");
	}
	else {$("div.answer", $(this).parent()).slideUp("fast");
	}
});
*/

///
/// End FAQ Sliding Function
///

///
/// FAQ Expand All/Collapse All Function
///

$('#expandFAQ').click(function() {
	$('div.answer').slideDown("fast");
});

$('#collapseFAQ').click(function() {
	$('div.answer').slideUp("fast");
});

///
/// End Expand All/Collapse All
///



///
/// jQuery nextUntil function (needed for subMenus)
///

$.fn.nextUntil = function(expr) {
    var match = [];

    // We need to figure out which elements to push onto the array
    this.each(function(){
        // Traverse through the sibling nodes
        for( var i = this.nextSibling; i; i = i.nextSibling ) {
            // Make sure that we're only dealing with elements
            if ( i.nodeType != 1 ) continue;

            // If we find a match then we need to stop
            if ( jQuery.filter( expr, [i] ).length ) break;

            // Otherwise, add it on to the stack
            match.push( i );
        }
    });

    return this.pushStack( match, arguments );

}; 

///
///	End nextUntil Function
///

});

///
/// End jQuery Functions
///

function popup(url, windowwidth, windowheight) {
	var y = parseInt((window.screen.availWidth - windowwidth)/2);
	var x = parseInt(((window.screen.availHeight - windowheight)/2) * .9);
	eval("detailswindow \= open\(url, \"details\", \"screenX="+x+", screenY="+y+", top="+x+", left="+y+", toolbar=yes, location=yes, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width="+windowwidth+", height="+windowheight+"\")");
}

function showHide(obj) {
	if (obj.style.display != 'block') {
		obj.style.display = 'block';
	} else {
		obj.style.display = 'none';
	}
}
