
jQuery.fn.reorder = function() {
 
  // random array sort from
  // http://javascript.about.com/library/blsort2.htm
  function randOrd() { return(Math.round(Math.random())-0.5); }
 
  return(jQuery(this).each(function() {
    var $this = jQuery(this);
    var $children = $this.children();
    var childCount = $children.length;
 
    if (childCount > 1) {
      $children.remove();
 
      var indices = new Array();
      for (i=0;i<childCount;i++) { indices[indices.length] = i; }
      indices = indices.sort(randOrd);
      jQuery.each(indices,function(j,k) { $this.append($children.eq(k)); });
 
    }
  }));
}

jQuery(document).ready(function($){
													 
	
	//Search 
	$("#searchbutt").attr("value","");	
	
	$("#s").focus(function() {
		$(this).attr("value","");
	});
											 					
	//Project Slideshow				 		
	$('#slideshow').cycle({
			fx:     'fade',
			random: 1
	});
	
	//LIghtbox
	$("a[rel*='lightbox']").lightBox();
	
	//Cufon
	Cufon.replace('h2')
	Cufon.now();
	
// SWFObject embed
var flashvars = {}
var params = { 
	allowfullscreen: "true",
	wmode: "transparent"
}                
var attributes = {
	id: "ssp"
}

//swfobject.embedSWF("/website/flash/ssp.swf", "flashcontent", "758", "540", "9.0.0", false, flashvars, params, attributes);	


$("#testlist").reorder();
	
});