// JavaScript Document
$(document).ready( function() {
	
	
	//caousel control
	$("#foo2").carouFredSel({
	    curcular: false,
		infinite: false,
	    auto : false,
		scroll: 1,
	    prev : {   
	        button  : "#foo2_prev",
	        key     : "left"
	    },
	    next : {
	        button  : "#foo2_next",
	        key     : "right"
	    }
	});
	
	//red events
		$("#newsticker-demo-red").jCarouselLite({
		vertical: true,
		hoverPause:true,
		btnPrev: ".previous-red",
		btnNext: ".next-red",
		visible: 3,
		auto:3000,
		speed:500
	});
		
	//blue events
		$("#newsticker-demo-blue").jCarouselLite({
		vertical: true,
		hoverPause:true,
		btnPrev: ".previous-blue",
		btnNext: ".next-blue",
		visible: 3,
		auto:3000,
		speed:500
	});
		
	//orange events
		$("#newsticker-demo-orange").jCarouselLite({
		vertical: true,
		hoverPause:true,
		btnPrev: ".previous-orange",
		btnNext: ".next-orange",
		visible: 3,
		auto:3000,
		speed:500
	});	
	
		 //twitter feed 
	if(jQuery().getTweetsList) {
		$('#twitter_transmission').getTweetsList({
			url:basepath+'/js/getTweetsList/php/getTweet.php',
			count:4,
			screenName:'iirtransmission',
			refresh:5,
            display:2,
			single:false,
			tag:'ol',
			RT:true,
			showAvatar:true,
			RTShowAvatar:false,
			config:'config_iirtransmission',
			OAuth:true
		});
		$('#twitter_telcoregulation').getTweetsList({
			url:basepath+'/js/getTweetsList/php/getTweet.php',
			count:4,
			screenName:'telcoregulation',
			refresh:5,
            display:2,
			single:false,
			tag:'ol',
			RT:true,
			showAvatar:true,
			RTShowAvatar:false,
			config:'config_iirtmobile',
			OAuth:true
		});
		$('#twitter_iirtmobile').getTweetsList({
			url:basepath+'/js/getTweetsList/php/getTweet.php',
			count:4,
			screenName:'iirtmobile',
			refresh:5,
            display:2,
			single:false,
			tag:'ol',
			RT:true,
			showAvatar:true,
			RTShowAvatar:false,
			config:'config_iirtmobile',
			OAuth:true
		});
	}



	// nav fix
    $.each( $.browser, function( i, val ) {
        if( i == 'msie' && val === true ) {
            switch ( parseInt( $.browser.version.substr( 0, 1 ), 10 ) ) {
                case 6:
                    $( 'body' ).addClass( 'ie6' );
                    $( '.menu > li' ).addClass( 'first-item' );
                    $( '.menu > li > a' ).addClass( 'first-link' );
                    $( '.menu > li > ul' ).addClass( 'first-child' );
                    $( '.menu li' ).hover( function( ) { $( this ).addClass( 'over' ) }, function( ) { $( this ).removeClass( 'over' ) } );
                    break;
                case 7:
                    $( 'body' ).addClass( 'ie7' );
                    break;
            }
        }
    });


	
	//code for fading testimonials
	var quotes = new Array();
	quotes[0] = "<cite>\"I found confident reasons to start upgrading our method of indoor solutions.\"<br>- <a href=\"http://www.iir-telecoms.com/event/ibs\">In-Building Summit</a></cite><p>Manager, Umniah</p>";
	
	quotes[1] = "<cite>\"Thanks IIR for an excellent and groundbreaking new event. The opportunity to meet and network with colleagues and contacts spanning a range of different PMR technologies and applications was both informative and rewarding. We at P3 look forward to returning to Barcelona for PMR Summit 2012!\"<br>- <a href=\"http://www.iir-telecoms.com/event/PMR\">PMR</a></cite><p>Tony Gray, P3 communications GmbH</p>";
	
	quotes[2] = "<cite>\"An exciting event with the latest updates on telco Loyalty!\"<br>- <a href=\"http://www.iir-telecoms.com/event/loyalty\">Telecoms Loyalty & Churn</a></cite><p>Loyalty Programme Senior Manager, Etisalat</p>";
	
	quotes[3] = "<cite>\"What I found particularly useful about the event was the range of delegates, from telecommunications, banking and payments industries.\"<br>- <a href=\"http://www.iir-telecoms.com/event/mobilepayment\">Mobile Payment Services</a></cite><p>Dave Birch, Director, Consult Hyperion</p>";
	
	quotes[4] = "<cite>\"A great opportunity to network, benchmark, stimulate creativity and make long term contacts.\"<br>- <a href=\"http://www.iir-telecoms.com/event/segmentation\">Telecoms Customer Segmentation & Intelligence</a></cite><p>KPN @ Telecoms Loyalty & Churn 2009</p>";
	
	quotes[5] = "<cite>\"A great opportunity to network and understand general industry standards.\"<br>- <a href=\"http://tnmo.optical-transmission.com\">Transport Networks for Mobile Operators</a></cite><p>Access Transport Manager, SafariCom</p>";
	
	quotes[6] = "<cite>\"Surprisingly deep insights from a variety of presenters, great to hear what colleagues are thinking.\"<br>- <a href=\"http://www.iir-telecoms.com/event/cloudservices\">Telecom Cloud Services Summit</a></cite><p>Executive Director, Strategy & Business Development, AT&T Business Solutions</p>";
	
	quotes[7] = "<cite>\"I have learned a lot about command and Control Rooms.\"<br>- <a href=\"http://www.iir-telecoms.com/event/controlrooms\">Control Room Communications</a></cite><p>Police Officer, Cyprus Police</p>";
	
	quotes[8] = "<cite>\"Widened perspectives, improved understanding, new contacts; I paid my own way and it was money well spent.\"<br>- <a href=\"http://www.iir-telecoms.com/event/networkstrategy\">Managed Services and Network Sharing</a></cite><p>Shared Access @ Network Sharing</p>";
	
	quotes[9] = "<cite>\"Good focus, good networking.\"<br>- <a href=\"http://mena.roamingworldcongress.com\">Roaming Congress MENA</a></cite><p>Analyst, TeliaSonera</p>";
	
	quotes[10] = "<cite>\"I now understand the forthcoming technologies required to fulfil the mobile broadband demand.\"<br>- <a href=\"http://www.iir-telecoms.com/event/mobilebroadband\">Mobile Broadband World</a></cite><p>Mohammed A Al-Rashed, CITC @ Mobile Broadband World 2008</p>";
	
	quotes[11] = "<cite>\"Very informative with the right decision makers attending.\"<br>- <a href=\"http://apac.carrierethernetworld.com\">Carrier Ethernet APAC</a></cite><p>Mike Ang, Vice President, Association of Telecoms Industry of Singapore</p>";
	
	quotes[12] = "<cite>\"I now understand the forthcoming technologies required to fulfil the mobile broadband demand.\"<br>- <a href=\"http://www.iir-telecoms.com/event/mbasia\">Mobile Broadband ASIA</a></cite><p>Mohammed A Al-Rashed, CITC @ Mobile Broadband World 2008</p>";
	
	quotes[13] = "<cite>\"It is the best event for networking and professional development in the roaming world.\"<br>- <a href=\"http://www.iir-telecoms.com/event/roaming\">Roaming World Congress</a></cite><p>G Drouillard, Rogers Wireless</p>";
	
	quotes[14] = "<cite>\"I learnt a lot from different countries presentations that can assist Namibia in the decision about number portability, excellent opportunity to build and broaden personal horizons.\"<br>- <a href=\"http://www.iir-telecoms.com/event/npme\">Number Portability Middle East</a></cite><p>Namibia Communications Commission</p>";
	
	quotes[15] = "<cite>\"It is important to keep up to date with developments, I have learned from the conference.\"<br>- <a href=\"http://www.tetraworldcongress.com\">Tetra World Congress</a></cite><p>P Ginger, Chairman ICC, Police Federation</p>";
	
	quotes[16] = "<cite>\"Interesting presentations and a good opportunity for meeting people.\"<br>- <a href=\"http://www.iir-telecoms.com/event/performance\">Mobile Network Performance</a></cite><p>Abdellah Bouirig, Orange France</p>";
	
	quotes[17] = "<cite>\"Very informative with the right decision makers attending.\"<br>- <a href=\"http://www.carrierethernetworld.com/me/home\">Carrier Ethernet Middle East & Africa</a></cite><p>Mike Ang, Vice President, Association of Telecoms Industry of Singapore</p>";
	
	quotes[18] = "<cite>\"I was inspired.\"<br>- <a href=\"http://www.iir-telecoms.com/event/cemme\">Customer Experience Management</a></cite><p>Sales Director, Nokia Siemens Networks</p>";
	
	quotes[19] = "<cite>\"Gathered new information from the CRM area.\"<br>- <a href=\"http://www.iir-telecoms.com/event/CEM-CRM-Retention\">Telecoms CEM, CRM & Retention</a></cite><p>Business Analyst, Vodafone</p>";
	
	var counter = 0;
	setInterval(function() {
		$("#testimonial-inner").fadeOut('1000', function() {
			$("#testimonial-inner").html(quotes[counter]);
		});
		if(counter == 19) {
			counter = 0;
		}
		counter++;
		/* Comes last to keep it in this state for 3000ms */
		$("#testimonial-inner").fadeIn('1000');
	}, 3000);
	


});
