jQuery(document).ready(function() {
	
	/*cycle*/
	$('#msg').cycle({
		fx: 			'scrollUp', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		timeout:         10000,
		next:			'#msg'  // milliseconds between slide transitions (0 to disable auto advance) 
		
		/*
		timeout:         4000,  // milliseconds between slide transitions (0 to disable auto advance) 
		timeoutFn:       null,  // callback for determining per-slide timeout value:  function(currSlideElement, nextSlideElement, options, forwardFlag) 
		continuous:      0,     // true to start next transition immediately after current one completes 
		speed:           1000,  // speed of the transition (any valid fx speed value) 
		speedIn:         null,  // speed of the 'in' transition 
		speedOut:        null,  // speed of the 'out' transition 
		next:            null,  // selector for element to use as click trigger for next slide 
		prev:            null,  // selector for element to use as click trigger for previous slide 
		prevNextClick:   null,  // callback fn for prev/next clicks:    function(isNext, zeroBasedSlideIndex, slideElement) 
		prevNextEvent:  'click.cycle',// event which drives the manual transition to the previous or next slide 
		pager:           null,  // selector for element to use as pager container 
		pagerClick:      null,  // callback fn for pager clicks:    function(zeroBasedSlideIndex, slideElement) 
		pagerEvent:     'click.cycle', // name of event which drives the pager navigation 
		allowPagerClickBubble: false,  // allows or prevents click event on pager anchors from bubbling 
		pagerAnchorBuilder: null, // callback fn for building anchor links:  function(index, DOMelement) 
		before:          null,  // transition callback (scope set to element to be shown):     function(currSlideElement, nextSlideElement, options, forwardFlag) 
		after:           null,  // transition callback (scope set to element that was shown):  function(currSlideElement, nextSlideElement, options, forwardFlag) 
		end:             null,  // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options) 
		easing:          null,  // easing method for both in and out transitions 
		easeIn:          null,  // easing for "in" transition 
		easeOut:         null,  // easing for "out" transition 
		shuffle:         null,  // coords for shuffle animation, ex: { top:15, left: 200 } 
		animIn:          null,  // properties that define how the slide animates in 
		animOut:         null,  // properties that define how the slide animates out 
		cssBefore:       null,  // properties that define the initial state of the slide before transitioning in 
		cssAfter:        null,  // properties that defined the state of the slide after transitioning out 
		fxFn:            null,  // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) 
		height:         'auto', // container height 
		startingSlide:   0,     // zero-based index of the first slide to be displayed 
		sync:            1,     // true if in/out transitions should occur simultaneously 
		random:          0,     // true for random, false for sequence (not applicable to shuffle fx) 
		fit:             0,     // force slides to fit container 
		containerResize: 1,     // resize container to fit largest slide 
		pause:           0,     // true to enable "pause on hover" 
		pauseOnPagerHover: 0,   // true to pause when hovering over pager link 
		autostop:        0,     // true to end slideshow after X transitions (where X == slide count) 
		autostopCount:   0,     // number of transitions (optionally used with autostop to define X) 
		delay:           0,     // additional delay (in ms) for first transition (hint: can be negative) 
		slideExpr:       null,  // expression for selecting slides (if something other than all children is required) 
		cleartype:       !$.support.opacity,  // true if clearType corrections should be applied (for IE) 
		cleartypeNoBg:   false, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides) 
		nowrap:          0,     // true to prevent slideshow from wrapping 
		fastOnEvent:     0,     // force fast transitions when triggered manually (via pager or prev/next); value == time in ms 
		randomizeEffects:1,     // valid when multiple effects are used; true to make the effect sequence random 
		rev:             0,     // causes animations to transition in reverse 
		manualTrump:     true,  // causes manual transition to stop an active transition instead of being ignored 
		requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded 
		requeueTimeout:  250,   // ms delay for requeue 
		activePagerClass: 'activeSlide', // class name used for the active pager link 
		updateActivePagerLink: null // callback fn invoked to update the active pager link (adds/removes activePagerClass style) 
		*/		
	});
	
	/*fancybox*/
	$("#howitworks").fancybox({
		'width'				: '480',
		'height'			: '330',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("#p01").fancybox({
		'width'				: '640',
		'height'			: '380',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("#p02").fancybox({
		'width'				: '640',
		'height'			: '380',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("#p03").fancybox({
		'width'				: '640',
		'height'			: '380',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("#p04").fancybox({
		'width'				: '640',
		'height'			: '380',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("#p05").fancybox({
		'width'				: '640',
		'height'			: '380',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("#p06").fancybox({
		'width'				: '640',
		'height'			: '430',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("#p07").fancybox({
		'width'				: '640',
		'height'			: '520',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$("#p08").fancybox({
		'width'				: '640',
		'height'			: '430',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	
});

/*MM*/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
