     jQuery.noConflict();
     
     // Put all your code in your document ready area
     jQuery(document).ready(function($){

$('ul li:last-child').addClass('last');	 
	 
	 
$('#mcs_container .customScrollBox').css('overflow','hidden');
$('.dragger_container').css('display','block');

	 	 //Clone List Elements Portfolio
$('#my-list li').clone().appendTo('#my-list');
$('#my-list li').clone().appendTo('#my-list');	 



var deviceAgent = navigator.userAgent.toLowerCase();
var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
if (agentID) {
   $(".customScrollBox").css('overflow','auto');
   $(".dragger_container").css('display','none');

   $(".container").removeClass('container').addClass('iscroller');
if (!!('ontouchstart' in window)) {
$('.iscroller').touchScroll();
}

//Innitalize Portfolio
    if ($('#my-list').length) {
$("#my-list").wrap('<div class="hoverscroll" id="iosscroller" />');
var myScroll = new iScroll('iosscroller', {
    snap: 'li',
    hScrollbar: false,
    vScrollbar: false });


function ready() {

    
    if (myScroll.currPageY == myScroll.pagesY.length-4) { myScroll.scrollToPage(0, 0, 1000);  } else
    { myScroll.scrollToPage(0, 'next', 400);}
    

}
var refreshIntervalId = setInterval(ready, 2000);

$('#iosscroller').live('vmouseover', function() { clearInterval(refreshIntervalId);
 });
 
 }


} else {
//Do stuff not for iOS)
  	 $("#mcs_container").mCustomScrollbar("vertical",400,"easeOutCirc",1.05,"auto","yes","yes",10);
	 
	 
	//Innitalize Portfolio

    if ($('#my-list').length) {

var myList = $('#my-list').hoverscroll({vertical: true, height: 520, width: 239}  );
myList[0].startMoving(1, 1); }

$('.listcontainer').mouseleave(function() {
  setTimeout(function(){
myList[0].startMoving(1, 1);
  }, 2000);
}
);
}






//Add Lightbox to portfolio
$('#my-list li a').click(function(e){  
e.preventDefault();
var thisHREF = $(this).attr('href');  
$('#portfolioLight').remove();    
$('#main').prepend('<div id="portfolioLight"><img src="'+ thisHREF +'" alt="" /><a href="#" id="close"><span>schlie&szlig;en</span></a></div>');
});
$('#portfolioLight #close').live('click',function(e){ 
e.preventDefault();
$('#portfolioLight').remove();
});

//Open Video
$('#openvideo').click(function(){$('#videocontainer').show(); jwplayer().play();});
$('#closevideo').click(function(){$('#videocontainer').hide(); jwplayer().stop();});
		 
		 
		 
//externe Links in neuem Fenster öffnen 
$('a[href]').not("[href^=javascript]").each(function() {
   var a = new RegExp('/' + window.location.host + '/');
   if(!a.test(this.href)) {
       $(this).click(function(event) {
           event.preventDefault();
           event.stopPropagation();
           window.open(this.href, '_blank');
       });
   }
});

		 
	//End of document Ready
     });



