function sponsor_carousel_initCallback(carousel) { // Pause autoscrolling if the user moves with the cursor over the clip. carousel.clip.hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); }; function opaqalize() { // embed $('embed').each(function() { if (!$(this).attr('wmode')) { $(this).attr({'wmode':'opaque'}); } }); // object $('object').each(function() { var e = document.createElement('param'); e.setAttribute('name','wmode'); e.setAttribute('value','opaque'); $(this).append(e); }); } function getScreen( url, size ) { if(url === null){ return ""; } size = (size === null) ? "big" : size; var vid; var results; results = url.match("[\\?&]v=([^&#]*)"); vid = ( results === null ) ? url : results[1]; if(size == "small"){ return "http://img.youtube.com/vi/"+vid+"/2.jpg"; }else { return "http://img.youtube.com/vi/"+vid+"/0.jpg"; } } function hide_all(){ $("#subheader img").hide(); $("#subheader h2").hide(); $("#subheader").find("a").removeClass("selected"); } function hide_all_turtles(){ $("#subheader_turtle_main_pic img").hide(); $("#subheader_turtle").find("a").removeClass("selected"); } $.fn.clearForm = function() { return this.each(function() { var type = this.type, tag = this.tagName.toLowerCase(); if (tag == 'form') return $(':input',this).clearForm(); if (type == 'text' || type == 'password' || tag == 'textarea') this.value = ''; else if (type == 'checkbox' || type == 'radio') this.checked = false; else if (tag == 'select') this.selectedIndex = -1; }); }; $.fn.qtip.styles.techstyle = { width: 200, textAlign: 'center', border: { width: 7, radius: 5 }, tip: 'topLeft', name: 'dark' // Inherit the rest of the attributes from // the preset dark style } $(document).ready(function(){ // Use the each() method to gain access to each elements attributes $('area').each(function() { $(this).qtip( { content: $(this).attr('alt'), // Use the ALT attribute of the area map style: { name: 'dark', // Give it the preset dark style border: { width: 0, radius: 4 }, tip: true // Apply a tip at the default tooltip corner } }); }); $('.hover').each(function() { $(this).qtip( { content: $(this).attr('alt'), // Use the ALT attribute of the area map style: { name: 'dark', // Give it the preset dark style border: { width: 0, radius: 4 }, tip: true // Apply a tip at the default tooltip corner } }); }); opaqalize(); // var img = $('.crop'); // img.crop({ height: 78, width: 111 }) var img = $('.crop'); img.crop({ height: img.attr('height'), width: img.attr('width'), transparentURL: "http://www.techunited.nl/transparent.gif" }) jQuery('#mycarousel').jcarousel({ // Configuration goes here }); jQuery('#sponsor_carousel').jcarousel({ auto: 5, wrap: 'last', buttonNextHTML: null, buttonPrevHTML: null, initCallback: sponsor_carousel_initCallback }); $(".youtube").colorbox({ width:"95%", height:"95%", current: "Video {current} van de {total}", iframe:true }); $(".popup").colorbox({ width:"680px", height:"95%" }); $("#nb_add").click(function(){ var lang = $("#nb_lang").attr('value'); var email = $("#nb_email").attr('value'); $("#followus_newsletter").load("inc/follownews.php?lang="+lang+"&email="+email, ""); }); var subh_count = 1; var cycleSubheaders = function(){ var element = $("#subheader h2:first"); for(var i=0; i < subh_count; i++){ element = element.next(); } var toShow = element.attr('id'); if(subh_count == 3){ subh_count=0; }else{ subh_count++; } changeSubheader(toShow); }; var changeSubheader = function(toShow){ if($("#subheader").find("#"+toShow).css('display')=='none'){ hide_all(); } $("#subheader").find("#"+toShow).stop(true, true).fadeIn('normal'); $('a[name='+toShow+']').addClass("selected"); } //Bij mouseOver veranderen van header. $("#subheader li").mouseover(function(){ var toShow = $(this).find("a").attr('name'); changeSubheader(toShow); }); //Automatisch veranderen $("#subheader").everyTime(4000, cycleSubheaders ); //Stoppen bij MouseOver $("#subheader").mouseover(function(){ $(this).stopTime(); }); //Weer starten bij MouseOut $("#subheader").mouseout(function() { $(this).everyTime(4000, cycleSubheaders ); }); $("#subheader_turtle_navigation li").mouseover(function(){ var toShow = $(this).attr('id'); if($("#subheader_turtle_main_pic").find("#"+toShow).css('display')=='none'){ hide_all_turtles(); } $("#subheader_turtle_main_pic").find("#"+toShow).stop(true, true).fadeIn('slow'); $(this).find("a").addClass("selected"); }); $('.react').live("submit", function() { var id = $(this).attr('reactid'); $.post("inc/addreact.php", $(this).serialize(), function(data) { $('#news_reactions_'+id).html(data); }); $(this).clearForm(); return false; }); $('a.showReact').live("click", function() { var id = $(this).attr('id'); var url = "inc/getreacts.php"; url = url + "?lang=nl&reactid="+id; $('#news_reactions_'+id).show().load(url, ""); $('#show_reactions_'+id).hide(); return false; }); $('a.hideReact').live("click", function() { var id = $(this).attr('id'); $('#news_reactions_'+id).hide(); $('#show_reactions_'+id).show(); return false; }); $("a.lightbox").colorbox({ maxWidth:"95%", maxHeight:"95%", current: "{current} van de {total}", previous: "Vorige", next: "Volgende", close: "Sluiten", slideshowStart: "Diavoorstelling starten", slideshowStop: "Diavoorstelling stoppen" }); // Select all links with lightbox class $("a[rel='lightbox']").addClass("thumbnail").colorbox({ maxWidth:"95%", maxHeight:"95%", current: "{current} van de {total}", previous: "Vorige", next: "Volgende", close: "Sluiten", slideshowStart: "Diavoorstelling starten", slideshowStop: "Diavoorstelling stoppen" }); // Select all links with lightbox class });