// JavaScript Document

//Twitter
//! <div id="twitter"><p>wird geladen <img src="img/indicator.gif" /></p></div>
function LoadTwitter()
{
	  getTwitters('twitter', { 
		  id: 'displaymedia', 
		  clearContents: true, 
		  count: 4, 
		  withFriends: false,
		  ignoreReplies: true,
		  template: '<div id="twitter-head">%time%</div><div id="twitter-text">%text%</div>'
	  });	  
}

//jQuery Ajax Load Page Function
function jQueryAjax(file,targetid,anker)
{
	jQuery.ajax({
	  type:"POST",
	  url: file,
	  cache: false,
	  success: function(html){
		jQuery("#"+targetid).empty();				//clear div
	   	jQuery("#"+targetid).append(html);		//insert
		Shadowbox.init({ skipSetup: true }); Shadowbox.setup(); //shadowbox init
		location.href="#"+anker;
		}
	});	
};

//MIME Plugin, Video, etc.
//doc: http://malsup.com/jquery/media/
function jQueryLoadMedia()
{	
	jQuery().ready(function(){
		jQuery('a.media').media();		
	});	
};

//jQuery TolTip /cluetip
//doc: http://plugins.learningjquery.com/cluetip/#getting-started
function jQueryTooltip(id)
{
	jQuery().ready(function(){
		jQuery(".tooltip").tooltip({
			tooltipcontentclass:id
		})
	});;
};

//Jquery SWFOBJECT Plugin
//doc:http://jquery.thewikies.com/swfobject/examples

function jQueryLoadVideo(id,filepath,w,h)
{
	jQuery().ready(function(){   
		
		jQuery('#'+id).flash({ 
			   
			swf: '/postproduction/includes/flvplayer.swf',
			height: h,
			width: w,
			params: {   
				play: true,
				loop: false,
				
				flashvars: {  
					file: filepath,
					autostart:true
				}  
			}
		}); 
	});
}

//Validate Form
//doc: http://www.position-relative.net
function jQuerySubmitForm(id)
{
	
	var formular = document.getElementById(id);
	
	if(jQuery("#"+id).validationEngine({returnIsValid:true}))
	{
		formular.submit();			
	}
};


//Accordion Menu Vertical
//doc: http://docs.jquery.com/UI/Accordion
function jQueryAccordionMenu()
{
	jQuery().ready(function(){	
							
		jQuery('#accordion').accordion({
			active: 'h3.selected',
			//event: 'mouseover',
			collapsible: true,
			autoHeight: false,
			showSpeed: 400,
			hideSpeed: 800
		});
	
		
	});
};

function jQueryShadowbox(init)
{
	Shadowbox.init({
    	language:   "de-DE",
    	players:    ["flv","swf","qt","iframe","html"]
	});
}


//needs a div #easylider, 
//doc: <div id="slider"><ul><li>....</li></ul></div>
function jQueryEasySlider()
{
	jQuery().ready(function(){	
		jQuery("#slider").easySlider({			
		});
	});		
};