	function gotofaq(ref){
		var newref = new String($(ref).attr("href"));
		newref = newref.split("_");
		var q_ref  = "#fq_"+newref[1];
		var a_ref  = "#fa_"+newref[1];
		eval("$('"+q_ref+"').css({backgroundColor:'#660'}); $.scrollTo('"+q_ref+"', {speed:700});");
		eval("$('"+a_ref+" p').css({color:'#D2D2A6'});");
		return false;
	}
	function backtotop(ref){
		var newref = new String($(ref).attr("href"));
		$.scrollTo(0,0, {speed:700});
		return false;
	}
	function resetColors(){
		$('.faq_a p').each(function(){
			$(this).css({color:'#FFF'});
		});
	}
	
	function interModal(id, page){
		document.location = "/docs/"+page+"?pclick="+id;
	}

function policies (label){
	$(".mainWrapper").prepend("<div class='polLink' id='pols'><a onclick='$.scrollTo($("+'"#policies"'+"), 750, {axis:"+'"'+"y"+'"'+"}); return false;' href='#policies'>"+label+" Policies</a></div>");
}

jQuery(document).ready(function(){
	
	$(".polLink a").click(function(){
		$.scrollTo("#policies", 400);
		return false;
	});
	
	$('.faq_q').mouseover(function(){
		$(this).css("color", "#FF5959");
	});
	$('.faq_q').mouseout(function(){
		$(this).css("color", "#999999");
	});
	$('.faq_q').click(function() {
		$(this).next().toggle(320, function(){
			 if($(this).is(":visible")){
				 resetColors();
			}
			$(this).children().css("color", "#FF5959");
		});
		return false;
	}).next().hide();
	
	if (typeof(pclick) != "undefined"){
		$("#"+pclick).click();	
	}
});
