﻿function pageLoad() 
      {
        $get("spnContentLeftPanelTitle").style.display = 'none';
        $get("imgAjaxLoaderLeftPanel").style.display = 'inline';
        $get("imgAjaxLoaderRightPanel").style.display = 'inline';
        
        Events.GetLinks(0, getLinksSuccess, getLinksFail);
        
        Events.GetFeaturedLinks(0, getFeaturedLinksSuccess, getFeaturedLinksFail);
      }
      
      // Event Handlers for Loading Links.
      function getFeaturedLinksSuccess(result)
      {
        $get("imgAjaxLoaderRightPanel").style.display = 'none';
        $get("divHorizontalScrollingContainer").innerHTML = result;
        $('a').click(function(e){
         e.stopPropagation();
        });
      }
      
      function getFeaturedLinksFail(error)
      {
        alert(error.get_message());
      }
    
      // Event handlers for links.
      function getLinks(iCategory)
      {
        $get("spnContentLeftPanelTitle").style.display = 'none';
        $get("imgAjaxLoaderLeftPanel").style.display = 'inline';
        Events.GetLinks(iCategory, getLinksSuccess, getLinksFail);
      }
    
      function getLinksSuccess(result)
      { $('#divVerticalScrollingContainer').trigger( 'goto', [ 0 ] );
        $get("divVerticalScrolling").innerHTML = result;
        $get("imgAjaxLoaderLeftPanel").style.display = 'none';
        $get("spnContentLeftPanelTitle").style.display = 'inline';
        $('a').click(function(e){
         e.stopPropagation();
        });
      }
      
      function getLinksFail(error)
      {
        alert(error.get_message());
        $get("imgAjaxLoaderLeftPanel").style.display = 'none';
        $get("spnContentLeftPanelTitle").style.display = 'inline';
      }
      
      function subscribe()
      {
        $get("imgAjaxLoaderRegister").style.display = 'inline';
        	//Build Checkbox string
	var txt="";
	txt = txt + "'";	if($("#cbCabaret").attr("checked")==true){
 		txt=txt + "Cabaret | ";
	}
	if($("#cbCircus").attr("checked")==true){
 		txt=txt + "Circus | ";
	}
	if($("#cbComedy").attr("checked")==true){
 		txt=txt + "Comedy | ";
	}
	if($("#cbFilm").attr("checked")==true){
 		txt=txt + "Film | ";
	}
	if($("#cbLiterature").attr("checked")==true){
 		txt=txt + "Literature | ";
	}
	if($("#cbLiveart").attr("checked")==true){
 		txt=txt + "Live Art | ";
	}
	if($("#cbLivemusic").attr("checked")==true){
 		txt=txt + "Live Music | ";
	}
	if($("#cbOther").attr("checked")==true){
 		txt=txt + "Other | ";
	}
	if($("#cbTheatre").attr("checked")==true){
 		txt=txt + "Theatre | ";
	}
	if($("#cbVisualart").attr("checked")==true){
 		txt=txt + "Visual Art | ";
	}
	
	//Remove Trailing comma
	var outstr = ((txt.charAt(txt.length-2,1) == "|") ? txt.substring(0,txt.length-2) : txt);
	outstr = outstr + "'";
	
    Events.Subscribe($get("txtFirstName").value, $get("txtLastName").value, $get("txtEmail").value, outstr, subscribeSuccess, subscribeFail);
      }
      
      function subscribeSuccess(result)
      {
        $get("imgAjaxLoaderRegister").style.display = 'none';
        $get("spnAjaxRegisterMessage").innerHTML = result;
      }
      
      function subscribeFail(error)
      {
        alert(error.get_message());
      }
      
      function gotoImage(anchorNumber)
      {
        $('#divHorizontalScrollingContainer').trigger( 'goto', [ anchorNumber ] );
      }

jQuery(function( $ ){
   
    // Register for updates text
    $(":text").placehold()
       
    // Vertical panel
	$('#divVerticalScrollingContainer').serialScroll({
		items: 'div.divVerticalScrollingItem',
		prev: '#btnArrowUp',
		next: '#btnArrowDown',
		axis: 'y',
		offset: 0, //when scrolling to photo, stop 230 before reaching it (from the left)
		start: 0, //as we are centering it, start at the 2nd
		duration: 300,
		force: true,
		stop: true,
		lazy: true,
		lock: false,
		step: 4,
		exclude: 3,
		//navigation:'#divTitlesTop a',
		cycle: false, //don't pull back once you reach the end
		easing: 'swing', //use this easing equation for a funny effect
		jump: true, //click on the images to scroll to them
		onBefore:function( e, elem, $pane, $items, pos ){
					/**
					 * 'this' is the triggered element 
					 * e is the event object
					 * elem is the element we'll be scrolling to
					 * $pane is the element being scrolled
					 * $items is the items collection at this moment
					 * pos is the position of elem in the collection
					 * if it returns false, the event will be ignored
					 */
					 //those arguments with a $ are jqueryfied, elem isn't.
					e.preventDefault();
					if( this.blur )
						this.blur();
				},
				onAfter:function( elem ){
					//'this' is the element being scrolled ($pane) not jqueryfied
				}

	});
	   
	// Sildeshow
	$('#divHorizontalScrollingContainer').serialScroll({
		items: 'li',
		prev: '#divContentRightPanelHeader a.btnArrowLeft',
		next: '#divContentRightPanelHeader a.btnArrowRight',
		axis: 'x',
		offset: 0, //when scrolling to photo, stop 230 before reaching it (from the left)
		start: 0, //as we are centering it, start at the 2nd
		duration: 300,
		force: true,
		stop: true,
		lazy: true,
		lock: false,
		cycle: false, //don't pull back once you reach the end
		easing: 'swing', //use this easing equation for a funny effect
		jump: true //click on the images to scroll to them

	});
	
	

});


//<[CDATA[



  var georgia = {
    src: 'siteFiles/js/fonts/georgia_min.swf'
    ,ratios: [7,1.32,8,1.31,12,1.27,19,1.23,28,1.19,30,1.17,31,1.18,45,1.17,61,1.16,62,1.15,67,1.16,116,1.15,117,1.14,123,1.15,124,1.14,1.15]
  };
  
  var arial = {
    src: 'siteFiles/js/fonts/arial_min.swf'
    ,ratios: [8,1.3,12,1.27,16,1.21,19,1.17,24,1.18,26,1.16,27,1.17,35,1.16,44,1.15,63,1.14,64,1.13,67,1.14,68,1.13,70,1.14,76,1.13,77,1.14,1.13]
  };

  // sIFR.domains = ['novemberborn.net'] // Don't check for domains in this demo
    
  sIFR.useStyleCheck = true;
  sIFR.forceWidth = true;
  sIFR.activate(georgia, arial);

  sIFR.replace(georgia, {
    selector: '#divTitlesTop p'
    ,wmode: 'transparent'
    ,thickness: -100
    ,css: [
      '.sIFR-root { color: #ffffff; leading: -2; letter-spacing: -1; font-size: 32px;}'
      ,'a { text-decoration: none; }'
      ,'.clsOrange { color: #FF7A00; }'
      ,'.clsYellow { color: #FFC300; }'
      ,'.clsGreen { color: #59C001; }'
      ,'.clsBlueLight { color: #5AC3FF; }'
      ,'.clsRed { color: #BB1E53; }'
      ,'.clsYellowLight { color: #8B8B00; }'
      ,'.clsPurple { color: #8225A3; }'
      ,'.clsBlue { color: #8290CE; }'
      ,'.clsGrape { color: #FF7AFF; }'
      ,'a:hover { text-decoration: underline; color:none; }'
    ]
  });
  
   
    sIFR.replace(georgia, {
    selector: '#divTitlesBottom p'
    ,wmode: 'transparent'
    ,thickness: -100
    ,css: [
      '.sIFR-root { color: #ffffff; font-size: 17px; leading: -2;  }'
      ,'a { text-decoration: none; color: #ffffff; }'
      ,'a:hover { text-decoration: underline; color:none; }'
     ]
  });
  
  sIFR.replace(georgia, {
    selector: 'h1, #divContentRight h2, #divFooter h2'
    ,wmode: 'transparent'
    ,thickness: -100
    ,css: [
      '.sIFR-root { color: #ffffff; leading: -2; letter-spacing: -1; font-size: 18px;}'
     ]
  });
  
  sIFR.replace(georgia, {
    selector: 'li.clsMainMenuLevel1 span.clsLevel1'
    ,wmode: 'transparent'
    ,thickness: -100
    ,css: [
      '.sIFR-root { font-size: 18px; leading: 0; }'
      ,'a { text-decoration: none; color: #888888; }'
      ,'.clsSelected { color: #ffffff; }'
      ,'a:hover { color: #ffffff; }'
     ]
  });
  
  
  sIFR.replace(arial, {
    selector: 'ul.clsAboutMenu li.clsMainMenuLevel2 span.clsLevel2'
    ,wmode: 'transparent'
    ,css: [
      '.sIFR-root { font-size: 10px; leading: 0; }'
      ,'a { text-decoration: none; color: #888888; }'
      ,'.clsSelected { color: #ffffff; }'
      ,'a:hover { color: #ffffff; }'
     ]
  });


  
 
  
  //]]>