$(document).ready(function(){
    // news ticker
    /*
	var options = {
	  	newsList: "#ticker",
		startDelay: 10
	}
	$().newsTicker(options);
	*/
	
	$('#frontNews > ul').cycle({ 
            fx:    'fade', 
            speed:  2500,
            timeout:  2000,
            pause: 1,
			pager: '.specialLinks',
			debug: 1,
        	pagerAnchorBuilder: function(idx, slide) {       
        		var text = jQuery(slide).children("a").eq(0).children("h2").eq(0).text();
	       		//var text = jQuery(slide).children("a").eq(0).children("h2").eq(0).text().substring(0,40);
	       		var link = '#';
        		//var text = 'hello';
        		console.log('idx:' + idx);
        		console.log(text);
        		console.log(link);
        		if(idx == 3) {
        			var output = '<li class="last"><a href="'+link+'"><span style="text-transform: uppercase;">' + text + '</span></a></li>';
        		} else {
        			// alert string to see if the quotes break it
                	var output = '<li><a href="'+link+'"><span style="text-transform: uppercase;">' + text + '</span></a></li>';
                }
        		console.log(output);                
                return output;
        	}
    });
	var curDomain = 'http://' + location.host;	
    $('#map').flash(
        { src: 'fileadmin/layout/default/swf/eventMap.swf',
          width: 550,
          height: 337,
          wmode: 'transparent',
          flashvars: { domain: curDomain }
        },
        { 
            expressInstall: true 
        }
    );
});

