function initCoworkers() {

    $('#coworkers-menu').find("a").click(function() {
     var href = $(this).attr('href');
		this.blur();
	    $('#ourteam').hide();
	    $('.coworkerlist').find('.current').hide();
	    $('.coworkerlist').find('.current').removeClass('current');
		$('#coworkers-menu li').removeClass('selected');
	    $('.coworkerlist').find(href).addClass('current');
	    $('.coworkerlist').find(href).removeClass('hidden');
	    $('html, body').animate({scrollTop:0}, 'fast');
		$(this).parent().addClass('selected');
	    $(href).show();
    });
}

function initNewslinks() {

    $('#newslist').find("a").live('click', function() {
        var href = $(this).attr('href');
		this.blur();
	    //$(href).show();
    });
}

		

    	function loadCapnews(url) {
			$.ajax({
				type: "GET",
				url: url,
				dataType: "xml",
				success: function(xml) {
				var id = 1;
					$(xml).find('newsitem').each(function(){
					    var id = $(this).attr('id');
						if (id <= 2) {
						var title = $(this).find('title').text();
						var url = $(this).find('url').text();
						var dateday = $(this).find('dateday').text();
						var datemonth = $(this).find('datemonth').text();
						$('<li id="news_'+id+'"></li>').html('').appendTo('#newslist-cap');
						$(this).find('desc').each(function(){
							var brief = $(this).find('brief').text();
							var long = $(this).find('long').text();
							$('<h2><a href="http://www.providerventure.com/'+url+'" target="_blank">'+title+'</a></h2>').appendTo('#news_'+id);
							$('<p></p>').html(brief).appendTo('#news_'+id);
							$('<p id="news'+id+'" class="hidden"></p>').html(long).appendTo('#news_'+id);
						});
					
					   }
					id++;
					});
				}
			});
        }


    	function loadVentnews(url) {
			$.ajax({
				type: "GET",
				url: url,
				dataType: "xml",
				success: function(xml) {
				var id = 1;
					$(xml).find('newsitem').each(function(){
					    var id = $(this).attr('id');
						if (id <= 2) {
						var title = $(this).find('title').text();
						var url = $(this).find('url').text();
						var dateday = $(this).find('dateday').text();
						var datemonth = $(this).find('datemonth').text();
						$('<li id="news_'+id+'"></li>').html('').appendTo('#newslist-vent');
						$(this).find('desc').each(function(){
							var brief = $(this).find('brief').text();
							var long = $(this).find('long').text();
							$('<h2><a href="http://www.providerventure.com/'+url+'" target="_blank">'+title+'</a></h2>').appendTo('#news_'+id);
							$('<p></p>').html(brief).appendTo('#news_'+id);
							$('<p id="news'+id+'" class="hidden"></p>').html(long).appendTo('#news_'+id);
						});
					
					   }
					id++;
					});
				}
			});
        }


    	function loadVentNewsAll(url) {
			$.ajax({
				type: "GET",
				url: url,
				dataType: "xml",
				success: function(xml) {
				var id = 1;
					$(xml).find('newsitem').each(function(){
						var title = $(this).find('title').text();
						var url = $(this).find('url').text();
						var dateday = $(this).find('dateday').text();
						var datemonth = $(this).find('datemonth').text();
						$('<li id="news_'+id+'"></li>').html('').appendTo('#newslist-vent');
						$(this).find('desc').each(function(){
							var brief = $(this).find('brief').text();
							var long = $(this).find('long').text();
							$('<h2><a href="http://www.providerventure.com/'+url+'" target="_blank">'+title+'</a></h2>').appendTo('#news_'+id);
							$('<p></p>').html(brief).appendTo('#news_'+id);
							$('<p id="news'+id+'" class="hidden"></p>').html(long).appendTo('#news_'+id);
						});
					id++;
					
					});
				}
			});
        }


    	function loadCapNewsAll(url) {
			$.ajax({
				type: "GET",
				url: url,
				dataType: "xml",
				success: function(xml) {
				var id = 1;
					$(xml).find('newsitem').each(function(){
						var title = $(this).find('title').text();
						var url = $(this).find('url').text();
						var dateday = $(this).find('dateday').text();
						var datemonth = $(this).find('datemonth').text();
						$('<li id="news_'+id+'"></li>').html('').appendTo('#newslist-cap');
						$(this).find('desc').each(function(){
							var brief = $(this).find('brief').text();
							var long = $(this).find('long').text();
							$('<h2><a href="http://www.providerventure.com/'+url+'" target="_blank">'+title+'</a></h2>').appendTo('#news_'+id);
							$('<p></p>').html(brief).appendTo('#news_'+id);
							$('<p id="news'+id+'" class="hidden"></p>').html(long).appendTo('#news_'+id);
							
						});
					id++;
					});
				}
			});
        }





$(document).ready(function(){
     	
     	
    $('.butt').hover(function() {
        $(this).css("cursor", "pointer");
    });

    $('.opac').hover(function() {
       $(this).css("opacity", "0.8");
        }, function() {
        $(this).css("opacity", "1");
    });     	
     	
    $('#logo').click(function() {
    	 parent.location.href="http://www.providerventure.com";
	    return false; 
	});	
     	
     	initNewslinks();
 });
