function openMovie(movie, title) { if (!title) title = 'PURE CYCLING TV'; openShadowbox('/pure_cycling_tv/video.html?file='+movie,'iframe',title, 480, 270); } function openYTMovie(youtoube_id, title, pctv_id) { var url; var browser_info = 'CCBot/1.0 (+http://www.commoncrawl.org/bot.html)'; var browser_type = 'standard'; if (browser_info && (browser_info.match(/ipod/i) || browser_info.match(/ipad/i) || browser_info.match(/iphone/i))) { browser_type = 'mobile'; } if (browser_type == 'standard') { url = 'http://www.youtube.com/v/'+youtoube_id+'&rel=1&autoplay=1&hd=1'; } else { url = 'http://www.youtube.com/embed/'+youtoube_id; } if (!title) title = 'Pure Cycling TV'; openShadowbox(url,'iframe',title, youtoube_id, pctv_id, 720, 430); } var openShadowbox = function(content, player, title, youtoube_id, pctv_id, width, height) { Shadowbox.open({ content: content, player: player, type: player, title: title, width: width, height: height, fb_like: youtoube_id, fb_pctv_id: pctv_id }); }; function setFBMetaTags(title, image_id) { // First, get the array of meta-tag elements metatags = document.getElementsByTagName("meta"); // Iterate through the array, listing them all // Update only the Title meta tag for (cnt = 0; cnt < metatags.length; cnt++) { var name = metatags[cnt].getAttribute("name"); var content = metatags[cnt].getAttribute("content"); // Update the Title meta tag if (metatags[cnt].getAttribute("property") == "og:title") { if (title != '' && title != 'Pure Cycling TV') { metatags[cnt].setAttribute("content", 'Canyon | Pure Cyling TV | ' + title); } } else if (metatags[cnt].getAttribute("property") == "og:image") { if (image_id != '') { metatags[cnt].setAttribute("content", 'http://www.canyon.com/img/pctv/'+image_id+'_img_teaser.jpg'); } } } }