var globalids = new Array();
jQuery(document).ready( function($) {

	if($().countdownToEvent) {
		$('#countdownToEvent').countdownToEvent({
			year:2012,
			month:11,
			day:14,
			hour:8,
			refresh:false,
			text:new Array('Days Left')
		});
	}

	if($().jCarouselLite){
		$(".exhibitor-list").jCarouselLite({
			vertical: true,
			visible: 10,
			auto:500,
			speed:1000
		});
	}
	
	if($.fn.getTweetsList) {
		
		$('#twitter').getTweetsList({
			url:basepath+'/js/getTweetsList/php/getTweet.php',
			count:7,
			screenName:'AllAboutCom',
			refresh:10,
            display:3,
			single:false,
			duration:8000,
			OAuth:true,
			showAvatar:true
		});
	}
	
	if($().newsTicker) {
		$('#latest_news_ticker').newsTicker();
	}
	
	$.jGFeed('http://comworldseries.blogspot.com/feeds/posts/default',
		function(feeds){
			// Check for errors
			if(!feeds){
			// there was an error
			return false;
			}
			// do whatever you want with feeds here
				for(var i=0; i<feeds.entries.length; i++){
				var entry = feeds.entries[i];
				var content = entry.content;
				//var content = entry.contentSnippet;

				var contentTruncate = content.substring(0,250);

				// Entry title

				$(".blog-entry").html($(".blog-entry").html()+"<p><span> <a target='_blank' href=\""+entry.link+"\">"+entry.title+"</a> </span></p><p>"+contentTruncate+" <a target='_blank' href=\""+entry.link+"\">...more</a></p>");
				}
			}, 1);
	
	if ("#companies-by-product"){
		$("#companies-by-product p").each(function(i){
			$(this).fadeOut();
		});
	}
	
	$.videoPopup({
		zIndex:500,
		jwplayer:true
	});
});

function update_form(companyids,productid){
	
	$("#companies-by-product p").each(function(i){
		$(this).fadeOut();
	});
	globalids[productid] = companyids;
	var results = []; 
	$(':checkbox:checked').each(function(i){
		results[i] = $(this).attr('id');
	});
	for (var i = 0; i < results.length; i++){
		var x = results[i];
		var temp = globalids[x];
		for (var j = 0; j < temp.length;j++){
			$('#'+globalids[x][j]).fadeIn(100);
		}
	}
	
	
	
	
	
}


