



/*Prepare the videolist including Paging*/
function videolist() {

$('.videodetails:has(a.youtube[href=""])').addClass("nolink");

$("a.textversion").click(function(event){
  event.stopPropagation();

});

$(".videodetails h4.chatisover").parent().find('a.youtube').remove();

$('.videodetails.linkzutranskript').click(function () { window.location = $(this).find('a.diskussionslink').attr("href"); $('.videodetails').removeClass('active'); $(this).addClass('active'); });


$("a.kurzvita").click(function(event){
  event.stopPropagation();
  // do something
 fenster = window.open(this.href, "Popupfenster", "width=320,height=300,resizable=yes,scrollbars=yes,status=no");
 fenster.focus();
return false;
});


/*Change movie on click*/


$('.videodetails.videokasten:not(.nolink)').click(function () {flashvideoLoad($(this).find('a.youtube').attr("href"),$(this).find('a.mov').attr("href")); $('.videodetails').removeClass('active'); $(this).addClass('active'); $.scrollTo( 0, 800 ); });

//$('.videodetails h4.chatisover').parent().click(function () { window.location = $(this).find('a.diskussionslink').attr("href"); $('.videodetails').removeClass('active'); $(this).addClass('active'); });
}


/*Function for movie load*/
function flashvideoLoad(path,mov) {
//path = path.replace("http://www.youtube.com/watch?v=", "http://www.youtube-nocookie.com/v/");
//path = path + "&hl=de&fs=1&rel=0";
  if (path.indexOf('http://www.pr-2049.de/') == 0) {path = path.replace("http://www.pr-2049.de", "");}

  if((!navigator.userAgent.match(/iPhone/i))||(!navigator.userAgent.match(/iPod/i)))
{



    $('#flash embed').remove();
    $('#flash').flash(
        { src: 'player.swf',
          width: 400,
          height: 325,
		  wmode: 'transparent',
          allowfullscreen: 'true',
		  flashvars: { image: 'http://www.pr-2049.de/design/bg_neu_01.jpg', streamer: '/xmoov.php', screencolor: '#000', file: path, autostart: 'true', stretching: 'uniform', aboutlink: 'http://www.koob-pr.com', abouttext: 'KOOB PR'}});

} else {
    $('#nuriphone a.iphone').attr("href", mov);
 }

};




function changetext(element) {
if ($(element).html() != "einklappen") {
$(element).html("einklappen");}
else {
$(element).html("weiterlesen");}
}



/*The onLoad function of JQuery*/
$(function () {
/*Do stuff to the DOM onload (Events etc.)*/


$("a.aufklappbutton").click(function() {$(this).parent().parent().parent().parent().find("div.ausklapp").slideToggle("slow"); changetext(this);return false;});




videolist();
if($('.videodetails:not(.nolink)').length) {
$('.videodetails:not(.nolink)').ahover({moveSpeed: 100, hoverEffect: function() {
        $(this)
            .animate({opacity: 0.5}, 750)
            .animate({opacity: 1.0}, 750)
            .dequeue();
        $(this).queue(arguments.callee);
    }});   }
/*Load first movie*/
//flashvideoLoad($('.videodetails:first').find('a.youtube').attr("href"));
//$('.videodetails:first').addClass('active');

});

