
/**
 * PEPS ROLLOVER FUNCTION
 **/

PEPS = {};
PEPS.rollover = 
{
   init: function()
   {
      this.preload();
      
      $(".ro").children("img").hover(
         function () { $(this).attr( 'src', PEPS.rollover.newimage($(this).attr('src')) ); }, 
         function () { $(this).attr( 'src', PEPS.rollover.oldimage($(this).attr('src')) ); }
      );
   },

   preload: function()
   {
      $(window).bind('load', function() {
         $('.ro').children("img").each( function( key, elm ) { $('<img>').attr( 'src', PEPS.rollover.newimage( $(this).attr('src') ) ); });
      });
   },
   
   newimage: function( src )
   { 
      return src.substring( 0, src.search(/(\.[a-z]+)$/) ) + '1' + src.match(/(\.[a-z]+)$/)[0]; 
   },

   oldimage: function( src )
   { 
      return src.replace(/1\./, '.'); 
   }
};

/**
 * ONLOAD ROLLOVER FUNCTIONS FOR PEPS ROLLOVER
 **/

$(function(){

    if(scripts_isIE6) $(document).pngFix();

    PEPS.rollover.init();

   
     $("#lNav > div").hover(function(){
         if($(this).attr("class")!="navArrowLock")
          $(this).toggleClass("navArrow"); 
    
     },function(){
         if($(this).attr("class")!="navArrowLock")      
          $(this).toggleClass("navArrow");
     });

     $('.alumniMore > a').click(function(){

         var divid = $(this).attr("rel");
         var toshow = $('#'+divid).children('td.alumInner').children('div').css("display");

	 if(toshow=="none"){
		$('#'+divid).children('td').children('div').show("normal");
		$(this).children("img").attr("src","/images/showMore2.gif");
	 }else{
		$('#'+divid).children('td').children('div').hide("normal");
		$(this).children("img").attr("src","/images/showMore.gif");
	 }
	// $('#'+divid).toggleClass("remove");


	return false;
     });
    

	$("a[rel^='lightbox']").prettyPhoto({
			animationSpeed: 'slow',
			padding: 40,
			opacity: 0.85,
			showTitle: false,
			allowresize: true,
			counter_separator_label: '/',
			theme: 'light_square'
	});


	$("a[rel^='printable']").click(function(){
		var href = $(this).attr("href");
		popWindowMenus(href,'PrintableWin','770','680');
		return false;
	});


     $("#useShipForBill1").click(function(){
	$("#regBillingForm").hide();
     });

     $("#useShipForBill2").click(function(){
	$("#regBillingForm").show();
     });

     $(".payType").click(function(){
	if($(this).attr("value") == "Credit Card"){
	  with(document.form1){
	   enableField(cc);
	   enableField(ccType);
	   enableField(expMonth);
	   enableField(expYear);
	   enableField(cvv);
	  }
	  $("#ccForm").show();
	} else {
	  with(document.form1){
	   disableField(cc);
	   disableField(ccType);
	   disableField(expMonth);
	   disableField(expYear);
	   disableField(cvv);
	  }
	  $("#ccForm").hide();
	}
     });

     $("#clearForm").click(function(){
	  clearForm(document.form1);
  	  $("#regBillingForm").hide();
	  $("#ccForm").show();
          with(document.form1)
	  {
            useShipForBill[0].checked = true;
	    customerAmount[0].checked = true;	     
	    paymentType[0].checked = true;
	    enableField(cc);
	    enableField(ccType);
	    enableField(expMonth);
	    enableField(expYear);
  	    enableField(cvv);
	  }
     });
});


