// JavaScript Document    <select onchange="JumpToIt(this)"> 
function JumpToIt(list) {
    var newPage = list.options[list.selectedIndex].value
    if (newPage != "None") {
        location.href=newPage
    }
}
		jQuery(document).ready(function() {
				
				$('#subject_input').hide();
				$('#txtSubject').change(onChange);
				
				function onChange() {
					var desiredName = $(this).attr('name');
					if ($('#'+desiredName).val()=='other') {
						$('#subject_input').show();
						$('#txtSubject').hide();
					} else {
					
					}
				}
				
				
				// Expand Panel
				$("#open").click(function(){
					if(typeof document.body.style.maxHeight === "undefined") {  //if ie6
					  if ($("#pulldown_form").length) { // implies *not* zero
						  $('#pulldown_form').hide();
					  } 
					}
					$("div#panel").slideDown("slow");
	
				});	
				
				// Collapse Panel
				$("#close").click(function(){
					if(typeof document.body.style.maxHeight === "undefined") {  //if ie6
					  if ($("#pulldown_form").length) { // implies *not* zero
						  $('#pulldown_form').show();
					  } 
					}
					$("div#panel").slideUp("slow");	
				});		
				
				// Switch buttons from "Log In | Register" to "Close Panel" on click
				$("#toggle a").click(function () {
					$("#toggle a").toggle();
					$("#hello").hide();
				});		
				$(".toggle2 a").click(function () {
					$("#toggle a").toggle();
					$("div#panel").slideDown("slow");
					$("#hello").hide();
				});		
				
				// easyslider
				if ($("#slider").length) { 
				$("#slider").easySlider({
					auto: true,
					continuous: true,
					controlsFade:true,
					numeric: true
				});
				}
				//feedback
				var y_fixo = $("div[id^='div_feedback']").offset().top;
				$(window).scroll(function () {
					var mtScroll = getScrollXY();
					$("div[id^='div_feedback']").animate({top: y_fixo+mtScroll[1]+"px"},{duration:500,queue:false});
				});
				
				$("div[id^='div_feedback_lateral']").click(
						function() {
							if($("div[id^='div_feedback']").css('left') == "0px")
								//$(this).css({right:-180});
								$("div[id^='div_feedback']").animate({left:-182},400);
							else
								//$(this).css({right:0});
								$("div[id^='div_feedback']").animate({left:0},400);
						}
					);
			});	


function getScrollXY() {
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	return [ scrOfX, scrOfY ];
}