	prev_slide = '#ps_slide1';
	prev_button = 'a#button1';
jQuery(function($) {
/* jQuery routines for Home page */
$(".launchpage").fancybox({
        'autoScale'     	: true,
        'transitionIn'		: 'none',
		'autoDimensions'  : false,
	'transitionOut'		: 'none',
	'type'			: 'iframe'
   });	
/* jQuery Elements for CUMAnet Products and Services */
    $('#bg-frame').cycle({
        fx:    'zoom',
		sync:  false,
		speed: 'fast',
        timeout: 0,
        pager: '#nav',
        pagerAnchorBuilder: function(idx, slide) {
            return '#nav li:eq(' + (idx) + ') a';
        }
    });
    $('.btn_ps').click(function() {
		var item = $(this).attr('id');
		var ix = item.substr(item.length-1);
		$(this).addClass('clicked');
        $(prev_button).removeClass('clicked');
		$(prev_slide).hide('1000');
		$('#ps_slide' + ix).show('3000'); 
		prev_slide = '#ps_slide' + ix;
		prev_button = 'a#button' + ix;
    });
/* End of Products and Services */

/* jQuery Elements for Why CUMAnet? */
		$(".why").hrzAccordion({eventTrigger:"click",openOnLoad:"1",handlePositionArray: "left,left,left"});
		$(".diagram").fancybox({ href: "/images/diagram.png" });
		$(".diagram").click(function() { $(this).click(); $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });
	// Flexible 
	   	$(".btnSS").fancybox({href: "/images/servicingsupport.png"});
		// Hover function
		// $(".btnSS").hover(function() { $(this).click(); $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });
		//Click function
		$(".btnSS").click(function() {/* $(this).click(); */ $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });
		
		$(".btnPS").fancybox({href: "/images/processingsupport.png"});
		$(".btnPS").click(function() { /* $(this).click(); */ $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });

		$(".btnCS").fancybox({href: "/images/comprehensivesolution.png"});
		$(".btnCS").click(function() { /* $(this).click(); */ $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });

		$(".btnOS").fancybox({href: "/images/originationsupport.png"});
		$(".btnOS").click(function() { /* $(this).click(); */ $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });

		$(".btnPM").fancybox({href: "/images/portfoliomanagement.png"});
		$(".btnPM").click(function() { /* $(this).click(); */ $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });
		
		$(".btnEfficiency").fancybox({href: "/images/pop_efficiency.png"});
		$(".btnEfficiency").click(function() { /* $(this).click(); */ $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });

		$(".btnConsistency").fancybox({href: "/images/pop_consistency.png"});
		$(".btnConsistency").click(function() { /* $(this).click(); */ $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });

		$(".btnScalability").fancybox({href: "/images/pop_scalability.png"});
		$(".btnScalability").click(function() { /* $(this).click(); */ $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });
/* End of Why CUMAnet? */
// Getting Started 
 		 $(".btnStep1").fancybox({href: "/images/step1.jpg"});
		// Hover function
		// $(".btnSS").hover(function() { $(this).click(); $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });
		//Click function
		$(".btnStep1").hover(function() { $(this).click();  $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });

		$(".btnStep2").fancybox({href: "/images/step2.jpg"});
		$(".btnStep2").hover(function() {  $(this).click();  $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });

		$(".btnStep3").fancybox({href: "/images/step3.jpg"});
		$(".btnStep3").hover(function() {  $(this).click();  $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });

		$(".btnStep4").fancybox({href: "/images/step4.jpg"});
		$(".btnStep4").hover(function() {  $(this).click();  $("#fancybox-overlay").remove(); }, function() { $.fancybox.close(); });
/* End of Getting Started */
/* management */
$(".profile").fancybox({
/* default width is 560px */
/* default height is 340px	*/
        'autoDimensions' : false,
	    'autoScale'     : true,
	    'height'        : '5',
	    'width'         : '6',
	    'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'speedIn'       : 500,
		'speedOut'       : 500,
		'type'			: 'iframe',
		'titlePosition'	: 'over',
		'showCloseButton'   : true
   });
/* Pop-up Contact Form */
$(".contact-us").fancybox({
/* default width is 560px */
/* default height is 340px	*/
        'autoDimensions' : false,
	    'autoScale'     : true,
	    'height'        : '5',
	    'width'         : '6',
	    'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'speedIn'       : 500,
		'speedOut'       : 500,
		'type'			: 'iframe',
/*		'title'         : 'Thank you for your interest in CUMAnet, LLC', */
		'titlePosition'	: 'over',
		'showCloseButton'   : true
   });
});
