

var ncount=1;
var listinglimit = 12;

$(document).ready(function()
{ 
	ncount++;

	setupMenus();
	setupCalender();
	setTweet();
	//setupShareit();
	
	//$('.biglogo').show();
	$('#content_content').hide();
	$('#content_content').html(""); 
	//$('.littlelogo').hide();

	setup_mobilyblocks();
	initalCat();
	
	//doEvents(0, "future");
	//alert("boo");
}); 


function initalCat()
{
	if(getmode)
	{
		//alert("getmode = " + getmode);
		if(getmode=='artist')
		{
			doArtists(getID);
		}
		else if(getmode=='venue')
		{
			doVenues(getID);
		}
		else if(getmode=='event')
		{
			doEvents(getID, "");
		}
		else if(getmode == "shows")// this works
		{		
			doEvents(0, "future");
		}
		else if(getmode == "past")// this works
		{
			doEvents(0, "past");
		}
		else if(getmode == "corporate")// this works
		{
			doCorporate();
		}
		else if(getmode == "kids")// this works
		{
			doKids();
		}

	}//if getmode
	else
	{
		doEvents(0, "future")
		//doJoinTop();
	}

}//initalCat()

function gaEvent(category, action, label)
{
	//if (_gaq) _gaq.push(['_trackEvent', category, action, label, value]); 
	if (_gaq) _gaq.push(['_trackEvent', category, action, label]);
} 

function doCorporate()
{
			getmode = "nada";
			pagetoget = "flash_scripts/static.php";
			postvars = {pagename : 'corporate'};
		$.post(pagetoget, postvars , function(data)
	  {
	   $("#content_content").hide(); 
	   if (data.length>0)
	   { 
	     $("#content_content").slideDown(); 
	     $("#content_content").html(data);
	   }
	  })//end post   
}

function doKids()
{
			getmode = "nada";
			pagetoget = "flash_scripts/static.php";
			postvars = {pagename : 'kids'};
		$.post(pagetoget, postvars , function(data)
	  {
	   $("#content_content").hide(); 
	   if (data.length>0)
	   { 
	     $("#content_content").slideDown(); 
	     $("#content_content").html(data);
	   }
	  })//end post   
}

function setup_mobilyblocks() 
{
    //mobilyblocks (new shareit)
    $('.socials').mobilyblocks({
    trigger: 'click', // click or hover
    direction: 'clockwise', // clockwise or counter
    duration: 800, // duration of animation
    zIndex: 50, // z-index value of 'li' elements
    widthMultiplier: 1.2
  });
  
  //$('.socials a').click()
  
  
  
}//setup_mobilyblocks


///////// CALENDER FUNCTIONS //////////////////


var theseDates = new Array();

function setupCalender()
{	
	$('#datepicker').datepicker({inline: true, beforeShowDay: highlightCalEvents, onSelect: calDateSelected, dateFormat: 'yy-mm-dd'});
	//$('#datepicker').datepicker({dateFormat: 'yy-mm-dd'});
	//$.post("flash_scripts/events.php", { getcal : true},  
	$.ajax({
		type: "POST",
		url: "flash_scripts/eventsCal.php",
		dataType: 'text/xml',
		data: {getcal : true},
		cache: false,

		success: function( xml, status )
		{   
		  $("#content_content").show(); 
		  processCalXML(xml)

		},//success
		 complete: function( xhr, status )
    {
      //alert( "status = " + status ) 
    },
    error: function( xhr, status, error )
    {
      alert( 'ERROR: ' + status ) ;
      //alert( xhr.responseText ) ;
    }
	});//end ajax 

}//setupCalender


function processCalXML(xml)
{
		  //$("#bugger").append("<br />success<br />got " + xml.length + "events<br />" );
		   if (xml.length >0)
		   { 	
				var xx = 1;
				//$("#content_content").append(xml);
				if (!window.DOMParser) xml = "<xml>" + xml + "</xml>";// this makes IE work a bit , at least it gets the righ number of events				
				$(xml).find("event").each(function()
			  {
		   		 xx ++;
				   var tempstartdate = $(this).find("startdate").text();
				   tempstartdate = $.datepicker.parseDate('yy-mm-dd', tempstartdate);
				   var temptip = $(this).find("artists").text() + "-" + $(this).find("location").text();
				   var tempdatearray =  {thedate:tempstartdate,thetip:temptip}; 
				   theseDates.push(tempdatearray);
			   //	$("#bugger").append("tip= " + tempstartdate + "(" + xx + ")<br />");
			  });//for each		
				$('#datepicker').datepicker('refresh');

		   }// if data
		  // else  $("#bugger").html("NOBODY HOME"); 	
}//processCalXML


function calDateSelected(dateStr) 
{
	//var dateFormatted = $.datepicker.formatDate('@', dateStr)
	//alert("date" + dateStr);
	doEvents(0, "", dateStr);

	// Load information about the event on the given date
}

function highlightCalEvents(date) 
{
  var isEventDate = false;
  var tooltiptext = "";
  var dataarray = Array();
 // alert("num dates " + theseDates.length);
  for (var i = 0; i < theseDates.length; i++) 
  {  
    if (theseDates[i]['thedate'].getTime() == date.getTime()) 
     {
        isEventDate = true;
        tooltiptext= theseDates[i]['thetip'];
        break;
     }
  }
  //array with [0] being true if the date is selectable, false if not, [1] being a CSS class for styling, [2] being an optional popup tooltip
  return [isEventDate, (isEventDate ? 'calevent' : ''),(isEventDate ? tooltiptext : '')];
}
///////// END CALENDER FUNCTIONS //////////////////


////////////////////////


function doEvents(eventID, timespanX, jsdate, from, limit)
{
		if(!from) from =0;
		if(!limit) limit =listinglimit;
		
		killBiglogo();
		$("#content_content").html("Getting Events Data"); 
		pagetoget = "flash_scripts/events.php";
		//alert("this page= " + rootpage);
		if(eventID)
		{
			gaEvent('gig', 'eventID', eventID);
			postvars = {getcss : true, thisID : eventID, rootpage: rootpage};
		}
		else if(jsdate)
		{
			gaEvent('gig', 'calenderdate', jsdate);
			postvars = {getcss : true, bydate: jsdate, rootpage: rootpage };
		}
		else
		{
			postvars = {getcss : true, timespan: timespanX, rootpage: rootpage, from:from, limit:limit};
		}
		//getnewsfeed();
		//alert('eventID=' + eventID)
		$.post(pagetoget, postvars , function(data)
	  {
	   if (data.length>0)
	   { 
	     $("#content_content").slideDown(); 
	     $("#content_content").html(data);
	     $("a[rel='colorboxpic']").colorbox({transition:"elastic"}); 
	     //do sub parars	     
				setupShareit();
					setup_mobilyblocks();
				 setupMenus();
	   }
	   else  $("#content_content").html("NOTHING ON. <br/>Please come back another time"); 

	  })//end post 
}//doEvents


function doArtists(artID, from, limit)
{		
		if(!from) from =0;
		if(!limit) limit =listinglimit;
		
		killBiglogo();
		$("#content_content").html("Getting Artist's Data"); 
		pagetoget = "flash_scripts/performers_xml.php";
		if(artID)
		{
			gaEvent('artist', 'artistID', artID);
			postvars = {  getcss : true, thisID : artID};
			//alert("getting artID = " + artID);
		}
		else
		{
			postvars = {getcss : true, thisID : 0, from:from, limit:limit};
		}
		//getnewsfeed();
		$.post(pagetoget, postvars , function(data)
	  {
	   //$("#content_content").hide(); 
	   if (data.length>0)
	   { 
	     $("#content_content").slideDown(); 
	     $("#content_content").html(data); 
	     $(".content_block_detail").hide();
	     $("a[rel='colorboxpic']").colorbox({transition:"elastic"});
	     //$("a[rel='colorboxvid']").colorbox({iframe:true, innerWidth:425, innerHeight:344});//turned off now but works with  the right links  
	    $(".selectDetail").show();
	     //do sub parars	 
	    setupMenus();
	    setupShareit();
			setup_mobilyblocks();        
	    jQuery(".content_block .content_subtitle").click( function() 
    	{
        $(".content_block_detail").slideUp();
        $(this).parent().find('.content_block_detail').slideDown();
        gaEvent('artist', 'artistListing', $(this).text());
        return false;       
    	}); //jQuery 
	   }
	   else  $("#content_content").html("NOBODY HOME"); 
	   	// .selectDetail
  	
	  })//end post 
}//doArtists

function doVenues(venueID)
{
		killBiglogo();
		$("#content_content").html("Getting Venue's Data"); 
		pagetoget = "flash_scripts/venues.php";
		if(venueID)
		{
			postvars = {getcss : true, thisID : venueID};
			//alert("getting artID = " + artID);
		}
		else
		{
			postvars = {getcss : true};
		}
		//getnewsfeed();
		$.post(pagetoget, postvars , function(data)
	  {
	   if (data.length>0)
	   { 
	     $("#content_content").slideDown(); 
	     $("#content_content").html(data); 
	     $(".content_block_detail").hide();
	    	$(".selectDetail").show();
	     //do sub parars	     
	    jQuery(".content_block .content_subtitle").click( function() 
    	{
        $(".content_block_detail").slideUp();
        $(this).parent().find('.content_block_detail').slideDown();
        gaEvent('venue', 'venueListing', $(this).text());
        return false;       
    	}); //jQuery 
	   }
	   else  $("#content_content").html("NOBODY HOME"); 

	  })//end post 
}//doVenues


function doNews(from, limit)
{
		if(!from) from =0;
		if(!limit) limit =listinglimit;
		
		killBiglogo()
		$("#content_content").html("Getting the News"); 
		pagetoget = "flash_scripts/news.php";
		postvars = {getcss : true, from:from, limit:limit};
		$.post(pagetoget, postvars , function(data)
	  {
	   $("#content_content").hide(); 
	   if (data.length>0)
	   { 
	     $("#content_content").slideDown(); 
	     $("#content_content").html(data); 
	      $(".content_block_detail").hide();
	      setupMenus();
	      //do sub parars
	     jQuery(".content_block .content_subtitle").click( function() 
    	{
        $(".content_block_detail").slideUp();
        $(this).parent().find('.content_block_detail').slideDown();
        gaEvent('news', 'newsListing', $(this).text());
        $("a[rel='colorboxpic']").colorbox({transition:"elastic"}); 
        return false;       
    });  
	   }
	   else  $("#content_content").html("NO NEWS"); 
	  })//end post 
	
}


function doGallery(galltype)
{
		killBiglogo();
		$("#content_content").html("Getting Pictures"); 
			getmode = "nada";
			pagetoget = "flash_scripts/pics4css.php";
			postvars = {getcss : true, galltype:galltype};
			
		$.post(pagetoget, postvars , function(data)
	  {
	   if (data.length>0)
	   {      
	     $("#content_content").hide(); 
	     $("#content_content").html(data); 
	     $("#content_content").slideDown(); 
	     $("a[rel='colorboxgalpic']").colorbox({slideshow:true});
	   }
	   else  $("#content_content").html("NO PICS"); 
	  }) 
}//doGallery



/* ////////////// JOIN FUNCTIONS  ////////////// */ 
function doJoinSubmit()
{

//alert('Handler for .submit() called.');
//return false;
		// validate and process form
		// first hide any error messages
    $('.error').hide();
		var errors = "";
	  var name1 = $("input#name1").val();
	  var name2 = $("input#name2").val();
	  var email = $("input#email").val();
	  var mobile = $("input#mobile").val();
	  var town = $("input#town").val();
	  var gender = $("input#gender").val();
	  var location = $("input#location").val();
	  
		if (name1 == "") {
     // $("label#name1_error").show();
      $("#joinreadout").html("<span class=\"required\">We need to know your name. Have you forgotten it already?</span>"); 
      $("input#name1").focus();
      return false;
    }
    
    	if (name2 == "") {
      $("#joinreadout").html("<span class=\"required\">OK. We have your first name. Got a second one?</span>"); 
      $("input#name2").focus();
      return false;
    }
		
		if (email == "") 
		{
      $("#joinreadout").html("<span class=\"required\">We need you email address too or how can we write to you?</span>"); 
      $("input#email").focus();
      return false;
    }

		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		if(reg.test(email) == false) 
		{
			 $("#joinreadout").html("<span class=\"required\">Call that an email address? Let's try again shall we</span>"); 
      $("input#email").focus();
			return false;
		}

		pagetoget = "flash_scripts/mailinglist.php";
		postvars = $("#joinform").serialize() + "&getcss=true&submit=true";
	
	$("#joinreadout").html("Transmitting data to the Funny Farm.<br/>Please hold on<br/><br/>"); 
		$.post(pagetoget, postvars , function(data)
	  {

	   if (data.length>0)
	   {  
	     var messageback = $(data).find("messageback").text();
	     var errormessage = $(data).find("errormessage").text();
	     var ok = $(data).find("ok").text();
	     if(ok == '1')
	     {
	     	killBiglogo();
	     	$("#content_content").html("<div class=\"content_subtitle\">ICC Mailing List</div><br/>" + messageback); 
	     	$("#content_content").show(); 
	    	}
		    else
		    {		    	
		    	$("#joinreadout").html("" + "<b>" + messageback + "</b><br/><span class=\"required\">" + errormessage +"</span><br/><br/>"); 			    		
		    }
	   }//if data
	   else  $("#joinreadout").html("<span class=\"required\">Failed to Submit. Please try again later.</span>"); 
	  }) ;

    return false;
};

 

function doJoin()
{

		killBiglogo()
			//getmode = "nada";
			pagetoget = "flash_scripts/static.php";
			postvars = {pagename : 'join'};
			
		$.post(pagetoget, postvars , function(data)
	  {
	   if (data.length>0)
	   {      
	     $("#content_content").hide(); 
	     $("#content_content").html(data); 
	     $("#content_content").slideDown(); 
	     
	     $('.error').hide();// not using this ??
		  //$('#joinform input.text_input').css({backgroundColor:"#FF0000"});
		  $('#joinform input.text_input').focus(function(){ $(this).css({backgroundColor:"#000099", color:"#fff" });});
		  $('#joinform input.text_input').blur(function(){ $(this).css({backgroundColor:"#eeeeff", color:"#000099" }); });
			$('#joinform input#name1').select().focus();
			//$('#joinform').submit(doJoinSubmit()) ;
			$('#joinform').submit(function()
			{
				gaEvent('signup', 'submit', 'mainform');
				doJoinSubmit();
				return false;
			});
	   }
	   else  $("#content_content").html("THERE WAS A HITCH. PLEASE TRY LATER"); 
	  });//post 
	
}//doJoin


function doJoinTop()
{

		//killBiglogo()
			pagetoget = "flash_scripts/static.php";
			postvars = {pagename : 'joinlittle'};			
		$.post(pagetoget, postvars , function(data)
	  {
	   if (data.length>0)
	   {      
	     $("#content_content").hide(); 
	     $(".littlejoin").html(data); 
	     //$("#content_content").slideDown(); 
	     
	     $('.error').hide();// not using this ??
		  //$('#joinform input.text_input').css({backgroundColor:"#FF0000"});
		  $('#joinform input.text_input').focus(function(){ $(this).css({backgroundColor:"#000099", color:"#fff" });});
		  $('#joinform input.text_input').blur(function(){ $(this).css({backgroundColor:"#eeeeff", color:"#000099" }); });
			$('#joinform input#name1').select().focus();
			//$('#joinform').submit(doJoinSubmit()) ;
			$('#joinform').submit(function()
			{
				gaEvent('signup', 'submit', 'littletopform');
				doJoinSubmit();
				return false;
			});
	   }
	  // else  $("#content_content").html("THERE WAS A HITCH. PLEASE TRY LATER"); 
	  });//post 
	
}//doJoin


/////////////////////////////// END DO  FUNCTIONS  /////////////////////////////////////////
function killBiglogo()
{
	 $(".littlejoin").html(""); 
		$('.biglogo').hide();
   $('.littlelogo').show();
  
}

//MENU CALLS
function doMenu(getwhat)
{ 
  gaEvent('menu', 'click', getwhat);
	killBiglogo()
  var getmode = "postcall";
  var pagetoget = "flash_scripts/about.php";//default
  var postvar = "";
//$("#content_content").slideUp();

//shows, news, signup, venues, artists, contact, shop, guy, gallery, partners, cuttings, past, forum, podcast

	if(getwhat == "news")// this works
	{
		doNews();
	}

	else if(getwhat == "shows")// this works
	{		
		doEvents(0, "future")
	}
	else if(getwhat == "past")// this works
	{
		doEvents(0, "past")
	}

	else if(getwhat == "artists")// this works
	{
		doArtists();
	}
	else if(getwhat == "venues")// this works
	{
		doVenues();
	}
	else if(getwhat == "corporate")// this works
	{
		doCorporate();
	}	
	else if(getwhat == "kids")// this works
	{
		doKids();
	}		
	
	else if(getwhat == "guy")// this works
	{
			getmode = "nada";
			pagetoget = "flash_scripts/static.php";
			postvars = {pagename : 'guy'};
			//getnewsfeed();
		$.post(pagetoget, postvars , function(data)
	  {
	   $("#content_content").hide(); 
	   if (data.length>0)
	   { 
	     $("#content_content").slideDown(); 
	     $("#content_content").html(data);
	   }
	  })//end post 

	}//end guy
	else if(getwhat == "sponsors")// this works
	{
			
			
			/*getmode = "nada";
			//pagetoget = "flash_scripts/static.php";
			pagetoget = "partners.html";
			//postvars = {pagename : 'sponsors'};
		$.post(pagetoget, postvars , function(data)
	  {
	   $("#content_content").hide(); 
	   if (data.length>0)
	   { 
	     $("#content_content").slideDown(); 
	     $("#content_content").html(data);
	   }
	  })//end post 
	  */
	  
	 // $('#result').load('partners.html');
	  getmode = "nada";
	  $("#content_content").hide(); 
	  $('#content_content').load('partners.html', function() 
	  {			
  			$("#content_content").slideDown(); 
  			//alert('Load was performed.');
  			
		});
	  

	}//end sponsors
	
	else if(getwhat == "contact")// this works
	{
			getmode = "nada";
			pagetoget = "flash_scripts/static.php";
			postvars = {pagename : 'contact'};
			//getnewsfeed();
		$.post(pagetoget, postvars , function(data)
	  {
	   $("#content_content").hide(); 
	   if (data.length>0)
	   { 
	     $("#content_content").slideDown(); 
	     $("#content_content").html(data);
	   }
	  })//end post 

	}//end guy	

	else if (getwhat == "shop")
	{
			parent.location='http://www.standupswitzerland.com/shop/';	
	}
	else if (getwhat == "forum")
	{
			parent.location='forum/';
	
	}//end forum

	else if (getwhat == "gallery")//workie
	{
			doGallery();
			
	}// end gallery
	else if(getwhat == "press")// this works
	{
		doGallery("cuttings");
	}
	else if(getwhat == "join")// this works
	{
		doJoin();
	}
	

/*

	if(getmode == "postcall" && pagetoget != "" )
	{
	  //alert("getpage=" +  pagetoget
	  $.post(pagetoget, postvars , function(data)
	  {
	   if (data.length>0)
	   { 
	     //$("#content_content").slideDown(); 
	     $("#content_content").show(); 
	     $("#content_content").html(data); 
	     //alert("ncount=" +  ncount);
	      //$('#content_content').hide();
	      $(".content_block_detail").hide();
	     jQuery(".content_block .content_subtitle").click( function() 
    	{
				// expland the right one
        $(".content_block_detail").slideUp();
        $(this).parent().find('.content_block_detail').slideDown();
        //$("a[rel='colorboxpic']").colorbox({transition:"fade"});   
        return false;       
    });   
	   }
	   else  $("#content_content").html("nada"); 
	  }) 
	}//if callcontent

	else if (getmode == "loadcall")
		{
			$("#content_content").show(); 
			//alert("pagetoget=" +  pagetoget);
			$("#content_content").html(""); 
			//$('#content_content').load(""+pagetoget+"");
			$('#content_content').load(""+pagetoget+"");
		}
  */
 
} //end doMenu

function setupMenus()
{

    //var active = jQuery("ul.menu li.active a").attr("href").replace("#","");
    //doMenu(active);
    
    //main menus
    jQuery(".menu span").click( function() 
    {
        jQuery(".menu span").removeClass("active");
        jQuery(this).addClass("active");
        jQuery(this).children("a").blur();
        var tab = jQuery(this).children("a").attr("href").replace("#","");
        //alert("Hello tab" + tab);
        doMenu(tab);       
        return false;       
    });

		//little logo clicked
    jQuery(".littlelogo").click( function() 
    {
       gaEvent('littlelogo', 'clicked', 'home');
        //alert("littlelogo clicked" );
        $("#content_content").html(""); 
        $('#content_content').hide();
        $('.biglogo').show();
    		//$('.littlelogo').hide();
    		//doJoinTop();
    		jQuery(".menu span").removeClass("active");   
        return false;      
    });	
    
    //footsteps]
        jQuery(".footsteps select").change( function() 
    {
       // var tab = jQuery(this).children("a").attr("href").replace("#","");
       //var footing = $("#footsteps option:selected").parent("option").attr("footmode");
      // var footing = $(".footsteps option:selected").val();
      // var footmode = $(".footsteps select").attr("footmode");
       
        var footing = $(this).find("option:selected").val();
       var footmode = $(this).attr("footmode");      
       
       doFoot(footing,footmode);      
       //alert("foot footing = " + footing + "" + footmode);
       return false;       
    });
    	

		//jQuery("#show_sources").click ( function () { jQuery('textarea').fadeIn(); } );
};// setupMenus ENDS


function doFoot(footing,footmode)
{
	//alert("footy" + footmode);
	if(footmode=="artists")
	{
		doArtists(0, footing);
	}
	else 	if(footmode=="past")
	{
		doEvents(0, "past", 0, footing)
		//alert("got events footy");
	}
	else 	if(footmode=="future")
	{
		doEvents(0, "future", 0, footing)
		//alert("got events footy");
	}
	else 	if(footmode=="news")
	{
		doNews(footing)
		//alert("got events footy");
	}
	
}



/////////////////// SHARE IT  //////////
	//grab all the anchor tag with rel set to shareit
	
function setupShareit()
{

	$('a[rel=shareit], #shareit-box').mouseenter(function() 
	{		
	//alert("mouseover");	
		//get the height, top and calculate the left value for the sharebox
		var height = $(this).height();
		var top = $(this).offset().top;
		
		//get the left and find the center value
		var left = $(this).offset().left + ($(this).width() /2) - ($('#shareit-box').width() / 2);		
		
		//grab the href value and explode the bar symbol to grab the url and title
		//the content should be in this format url|title
		var value = $(this).attr('href').split('|');
		
		//assign the value to variables and encode it to url friendly
		var field = value[0];
		var url = encodeURIComponent(value[0]);
		
		var title = encodeURIComponent(value[1]);
		
		//assign the height for the header, so that the link is cover
		$('#shareit-header').height(height);
		
		//display the box
		$('#shareit-box').show();
		
		//set the position, the box should appear under the link and centered
		$('#shareit-box').css({'top':top, 'left':left});

		//$("#shareit-header").html("SHARE"); //oli
			
		//assign the url to the textfield
		$('#shareit-field').val(field);
		
		//make the bookmark media open in new tab/window
		$('a.shareit-sm').attr('target','_blank');
		
		//Setup the bookmark media url and title
		$('a[rel=shareit-mail]').attr('href', 'mailto:?subject=' + title + '&body=' + url);//doesnt work right
		$('a[rel=shareit-delicious]').attr('href', 'http://del.icio.us/post?v=4&noui&jump=close&url=' + url + '&title=' + title);
		$('a[rel=shareit-designfloat]').attr('href', 'http://www.designfloat.com/submit.php?url='  + url + '&title=' + title);
		$('a[rel=shareit-digg]').attr('href', 'http://digg.com/submit?phase=2&url=' + url + '&title=' + title);
		$('a[rel=shareit-stumbleupon]').attr('href', 'http://www.stumbleupon.com/submit?url=' + url + '&title=' + title);
		$('a[rel=shareit-twitter]').attr('href', 'http://twitter.com/home?status=' + title + '%20-%20' + url );
		
		$('a[rel=shareit-facebook]').attr('href', 'http://www.facebook.com/sharer.php?u='  + url + '&t=' + title );
		$('a[rel=shareit-google]').attr('href', 'http://www.google.com/bookmarks/mark?op=edit&bkmk='  + url + '&title=' + title );
		
		$('a[rel=shareit-myspace]').attr('href', 'http://www.myspace.com/Modules/PostTo/Pages/?u='  + url + '&t=' + title );
		
		$('a[rel=shareit-reddit]').attr('href', 'http://reddit.com/submit?url='  + url + '&title=' + title );
		
		//FACEBOOK   http://www.facebook.com/share.php?u=PERMALINK&t=TITLE
		
		//Google    http://www.google.com/bookmarks/mark?op=edit&bkmk=PERMALINK&title=TITLE&annotation=EXCERPT
		
		//MySpace   http://www.myspace.com/Modules/PostTo/Pages/?u=PERMALINK&t=TITLE

		//Reddit  http://reddit.com/submit?url=PERMALINK&title=TITLE

	
		
	});//mouseenter

	//onmouse out hide the shareit box
	$('#shareit-box').mouseleave(function () {
		$('#shareit-field').val('');
		$(this).hide();
	});//mouseleave
	
	//hightlight the textfield on click event
	$('#shareit-field').click(function () {
		$(this).select();
	});
	
} //setupShareit()	



function setTweet()
{
        $(".tweet").tweet({
            username: "funnylaunderer",
            join_text: "auto",
            avatar_size: 14,
            count: 4,
            auto_join_text_default: "we said,",
            auto_join_text_ed: "we",
            auto_join_text_ing: "we were",
            auto_join_text_reply: "we replied to",
            auto_join_text_url: "we were checking out",
            loading_text: "loading tweets..."
        });//tweet
}// setTweet()

