// PARAMETER FUNCTIONS
function getParams(from) {
	var params = {};
	if($(from).attr("params")){
		$.each($(from).attr("params").split(","), function(){		
			var thiskey = this.split(":")[0];
			//var thisval = this.split(":")[1]; 
			// enhanced for url
			var thisval = this.substr(this.split(":")[0].length+1,this.length);
			tmpobj = {};
			eval("tmpobj." + thiskey + "=thisval");
			jQuery.extend(params,tmpobj);	
		});
		return params;
	}
}

//start jQuery
$(function(){
	
	//slideshow
	$('#slideshow').cycle({
		fx:     	'scrollHorz',
        speed:  	500,
        timeout: 	7000,
        pager:  	'#pager'
    });
    
	$("div#slideshow").mouseover(function(){
		$(this).cycle('resume');
	}).mouseout(function(){
		$(this).cycle('pause');
	});
	
	//Scrollbar
	$('#twitterscroll').tinyscrollbar();
	
	$('#twitterscroll').hover(function() {
		$("#twitterscroll .track").stop().animate({ opacity : 1 }, 500);
	}, function() {
		$("#twitterscroll .track").stop().animate({ opacity : 0 }, 500);
	});

	//placeholder fix	
	$('[placeholder]').focus(function() {
	  var input = $(this);
	  if (input.val() == input.attr('placeholder')) {
	    input.val('');
	    input.removeClass('placeholder');
	  }
	}).blur(function() {
	  var input = $(this);
	  if (input.val() == '' || input.val() == input.attr('placeholder')) {
	    input.addClass('placeholder');
	    input.val(input.attr('placeholder'));
	  }
	}).blur();
	
	$('[placeholder]').parents('form').submit(function() {
	  $(this).find('[placeholder]').each(function() {
	    var input = $(this);
	    if (input.val() == input.attr('placeholder')) {
	      input.val('');
	    }
	  })
	});

});
