
// function to show componentdemos and comptips
function doublefire(divname){
	$(divname).css({"visibility":"visible","z-index":"15","width":"0px"}).animate({"width":"800px"},1500,function(){});
}


// Diese Funktion brauche ich für die Infotour. Wenn man bei -> Komponeten->Bog auf Zurück drückt (blogerklärung), soll der div beim schließen der 
// blogdemo den halbtransparenten abdunklungsdiv (smoothe) wiederherstelen.
function rebuild(divname){
	$(divname).css({"visibility":"visible","z-index":"100","opacity":"0"}).animate({"opacity":"0.8","filter":"alpha(opacity=80)","-moz-opacity": "0.8"},1200);
}

// Diese Funktion brauche ich für die Infotour. Wenn man bei -> Komponeten->Bog auf Zurück drückt (blogerklärung), soll der div beim schließen der 
// blogdemo den halbtransparenten abdunklungsdiv (smoothy) wiederherstelen.
function rebuilds(divname){	
	$(divname).css({"visibility":"visible","z-index":"100","opacity":"0"}).animate({"opacity":"1","filter":"alpha(opacity=100)","-moz-opacity": "1"},1200);
}

function underkill(divname){
	$(divname).css({"visibility":"visible","z-index":"9","opacity":"0"}).animate({"opacity":"1","filter":"alpha(opacity=100)","-moz-opacity": "1"},1200);
}


function showDiv(divname){
	$(divname).css({"visibility":"visible","z-index":"10","opacity":"0"}).animate({"opacity":"1","filter":"alpha(opacity=100)","-moz-opacity": "1"},1200);
}

function hideDiv(divname){	
	$(divname).animate({"opacity":"0","z-index":"0"},1200, null, function(){
		$(this).css({"visibility":"hidden","opacity":"0","z-index":"0"})
		});		
}
	
function hideDivhard(divname){
	$(divname).css({"visibility":"hidden","opacity":"0","z-index":"0"});		
}

//Function added 05_15_09 for showing the references
function showRefn(divname){
$(divname).css({"visibility":"visible","z-index":"30"}).show(1200);
}

//Infotour functions

// showing the references
function showRef (firstdiv,secdiv,textdiv,posy,posx){
	if ($(firstdiv).hasClass("shown") == false){
		showDiv (firstdiv);
		showDiv (secdiv);
		$(firstdiv).addClass("shown");
	}

	$(secdiv).css({"background-position":posy+"px "+posx+"px"});
	$('div.refdeztxt').each(function (x,y){
		if('#'+y.id != textdiv){
			$('#'+y.id).css({display:'none'});
		}else{
			$(textdiv).css({display:'block'});
		 }});
}
//
//showing the iframe with the component demos -- toDO:ajax call!
function showIframe (url, target){

	$(target).empty().css({"visibility":"visible","z-index":"15","width":"0px"}).animate({"width":"800px"},1500,function(){
 	$(this).append('<iframe src="http://websein.com/demojoomla/'+url+'&showbutton'+' "width="744px" height="360px" frameborder="0" scrolling="no" name="Picgallerydemo1"><p>Ihr Browser kann leider keine eingebetteten Frames anzeigen:Sie k?nnen die eingebettete Seite ?ber den folgenden Link aufrufen: <a href="'+url+'">DEMO</a></p></iframe>');
	});
}

function getSrcUrl(){

	return window.location;
}

visiblePanels=new Array();

function toggle(divname,scrollToElem){
	$(divname).slideToggle('slow',function(){
		scroll = $('.content')[0];
//		console.info(scroll);
		scroll.refresh();

		if(visiblePanels[scrollToElem]===undefined){
			scroll.scrollTo(scrollToElem,false);
			visiblePanels[scrollToElem]="isVivisible";
			//console.info("scrolled to : add entry ");
		}else{
			//console.info("no scroll : delete entry");
			delete visiblePanels[scrollToElem];
			scroll.scrollTo(0,false);
		}
	});
}

$(document).ready(function(){

	$('.content').jScrollPane({showArrows:false,dragMaxHeight :31});
//scrolltofunction for contact
$('#contact_text').focus(function(){
$('.content')[0].scrollTo(170); 
});
$('#contact_subject').focus(function(){
$('.content')[0].scrollTo(0); 
});

});// document ready