sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


function setText() {

	var rand_no = Math.ceil(2*Math.random());

	
	var text1 = '<p class="z-ltred justify"><strong>Presents</strong> a rich array of informative speakers discussing crucial issues of our time.</p><p class="z-ltred justify"><strong>Promotes</strong> legislation in Congress to cut off United States funds going to Fatah and Hamas.</p><p class="z-ltred justify"><strong>Raises</strong> funds to create scholarships and send students to study in Isreal.</p><p class="z-ltred justify"> <strong>Safeguards</strong> the interest of Israel on Capitol Hill, in the courts, and in the media. </p>';
			
	var text2 = '<p class="z-blue justify">The ZOA, founded in 1897, is a charter member of the Conference of Presidents of Major American Jewish Organizations. ZOA works to strengthen U.S.-Israel relations, educates the American public and Congress about the dangers that Israel faces, and combats anti-Israel bias in the media and on college campuses. The ZOA&#8217;s past presidents include U.S. Supreme Court Justice Louis D. Brandeis, Rabbi Dr. Abba Hillel Silver and Rabbi Stephen Wise. The ZOA&#8217;s Center for Law and Justice was established to meet the need for greater organizational involvement in legal matters that affect relations among the United States, Israel and the Jewish people.</p><p class="z-blue center bold"><em>ZOA is on the front lines of Jewish Activism.</em></p>';
	
	
	if(rand_no == 1) {
	
	     var html = text1;
	
	} else {
	
		var html = text2;
	}


	document.getElementById('leftText').innerHTML = html;

}

function show(whichOne){
	if(whichOne == 1){
		tDiv = "div1";
		vDiv = "div2";
		var showNext = 2;
	}else{
		tDiv = "div2";
		vDiv = "div1";
		var showNext = 1;
	}
	if($(tDiv).fx){$(tDiv).fx.stop();}
	if($(vDiv).fx){$(vDiv).fx.stop();}
	$(tDiv).fx = $(tDiv).effect('opacity', {duration: 2000}).start(0);
	$(vDiv).fx = $(vDiv).effect('opacity', {duration: 2000}).start(1);
	
	setTimeout("show("+showNext+")", 30000);

            
}

            
function validateDonationForm() {
    	    
    	   
    	    var donationLevel = getradioSelection("accept-donation");
            
            if(donationLevel == "membership") {
            	
          	  var memberLevel = getradioSelection("membership-level");
          	  
          	  if(memberLevel.length < 1) {
          	  		alert("You Must indicate a membership type to continue")
            		return false;
            	}
            	
            } else if(donationLevel == "already-member-additional-donation") {
            
            	var donationAmount = document.donate_form.donation-amount.value;
            	
            	if(isInteger(donationAmount) == false) {
        	
    	        	alert("you want to make a donation");
					return false;
            	}
            	
            		return true;
            		
            } else if(donationLevel == "no-donation") {
            	
            	alert("you want cake");
				return true;
			}
			
}
			
function getradioSelection(group)  { 
  for(var k=0;k<group.length;k++) 
    if(group[k].checked)  
       return group[k].value; 
} 

function isInteger(val) {

   return (val == null || isNaN(val)) ? false : 
      ( ((1.0 * val) == Math.floor(val)) && (val.indexOf(".") == -1));

}

