
$(document).ready(function() {
	
		initCufon();
		
		$('#main .frame').jScrollPane();
		
		$("label.inField").inFieldLabels();
		
		//-----------------------------------------------------------------------
		// Lightbox for jQuery
		/*
		$('.lightbox').lightBox({ //apply lightbox
			overlayBgColor: '#FFF',
			overlayOpacity: 0.7,
			imageLoading: '../img/blank.gif',
			containerResizeSpeed: 200,
			txtImage: 'Bild',
			txtOf: 'von'
		});
		*/
		//-----------------------------------------------------------------------
	
		//-----------------------------------------------------------------------
		// imageCrossFader home / produkte
		
        if($('#crossfade-images-home').length){
	        $('#crossfade-images-home').imageCrossFader({
	                fadeIn: 1500,
	                fadeOut: 1500,
	                delay: 4000
	        });
        }
        
        if($('#crossfade-images-produkte').length){
			 $('#crossfade-images-produkte').imageCrossFader({
	                fadeIn: 800,
	                fadeOut: 800,
	                delay: -1
	        });
		}
        if($('#crossfade-images-news').length){
			 $('#crossfade-images-news').imageCrossFader({
	                fadeIn: 800,
	                fadeOut: 800,
	                delay: 5000,
	                index: true,
	                relTextSrcId: '#news-content-',
	                relTextTargetId: '.holder .frame div'
	        });
		}
        
        //-----------------------------------------------------------------------

        
        //-----------------------------------------------------------------------
        $('.googleMaps').bind('click', function(){
        	window.open('http://maps.google.com/maps?f=q&source=s_q&hl=de&geocode=&q=riposa+Bahnhofstrasse+33+CH-8865+Bilten&aq=&sll=47.192046,8.964844&sspn=0.505332,0.944824&ie=UTF8&hq=riposa&hnear=Bahnhofstrasse+33,+8865+Bilten,+Glarus,+Schweiz&ll=47.151202,9.028358&spn=0.247024,0.472412&z=12&iwloc=A','Google MAps');
		});
        //-----------------------------------------------------------------------
        
		
});


function confirmCancel(){
	
	return confirm('ACHTUNG: Alle Änderungen werden verworfen!');
	
}

function goTo(goURL){
	
	document.location.href=base_url+goURL;
	
}

function editorWindow(contentName,currentLanguage){
	
	window.open('editor/edit/'+contentName+'/'+currentLanguage, "Editor_"+contentName, "width=1000,height=430,resizable=yes");
	 
}

//-----------------------------------------------------------------------

function _refresh (x,y) {$(x).mouseout(function(){setTimeout(function(){Cufon.refresh(y)}, 10);});}

function initCufon() {
	//Cufon.replace('#product-textbox .content', { fontFamily: 'es_std'});
	Cufon.replace('ul.menu a', { fontFamily: 'es_std', hover: true });
	Cufon.replace('#nav>li>a', { fontFamily: 'es_std', hover: true });
	Cufon.replace('#nav>li>ul>li>a', { fontFamily: 'es_std'});
	Cufon.replace('#list a', { fontFamily: 'es_std', hover: true });
	Cufon.replace('div.ad a', { fontFamily: 'es_std', hover: true });
	Cufon.replace('div.frame h2', { fontFamily: 'es_std', hover: true });
	_refresh('#nav>li','#nav>li>a');
	_refresh('#nav>li','#nav>li>ul>li>a');
	_refresh('#list a');
}
//-----------------------------------------------------------------------
