var locationURLVideo = ""; var locationURL3D = ""; var locationBlanck = ""; function videoManagerForIEAndChrome(tabIndex){ if(tabIndex == 0 || tabIndex == 1){ stopVideos(); } if(tabIndex == 2){ startVideo('player_video', locationURLVideo); stopVideo('player_3d'); } if(tabIndex == 3){ startVideo('player_3d', locationURL3D); stopVideo('player_video'); } } function startVideo(player_id, url_value){ window.frames[player_id].location.href = url_value; } function stopVideos(){ stopVideo('player_video'); stopVideo('player_3d'); } function stopVideo(player_id){ if(window.frames[player_id] != null){ window.frames[player_id].location.href = locationBlanck; //window.frames[player_id].location.reload(); } } function resizeVideos() { resizeVideo('player_video'); resizeVideo('player_3d'); } function initVideoGlobalVariable(){ // init global variables if(window.frames['player_video'] != null){ locationURLVideo = window.frames['player_video'].location.href; if (navigator.userAgent.indexOf('Firefox') != -1){ var embedsObject = window.frames['player_video'].document.getElementsByTagName('embed'); var embedObject = embedsObject[0]; //alert("embedObject " + embedsObject + " , " + embedObject + " " + embedObject.getAttribute('wmode')); embedObject.setAttribute('wmode',''); } } if(window.frames['player_3d'] != null){ locationURL3D = window.frames['player_3d'].location.href; if (navigator.userAgent.indexOf('Firefox') != -1){ var embedsObject = window.frames['player_3d'].document.getElementsByTagName('embed'); var embedObject = embedsObject[0]; //alert("embedObject " + embedsObject + " , " + embedObject + " " + embedObject.getAttribute('wmode')); embedObject.setAttribute('wmode',''); } } if(window.frames['player_3d'] != null || window.frames['player_video'] != null){ locationBlanck = locationURLVideo.substring(0,locationURLVideo.lastIndexOf('/')); locationBlanck += '/handset_iframe_blanck.jsp'; } //alert("_"+locationBlanck + " locationURLVideo.lastIndexOf('/') " + locationURLVideo.lastIndexOf('/')); //alert("locationURLVideo " + locationURLVideo + " locationURL3D " + locationURL3D + "locationBlanck " + locationBlanck); } function resizeVideo(player_id) { if(window.frames[player_id] == null){ return; } var embeds_video = window.frames[player_id].document.getElementsByTagName('embed'); var embed_video = embeds_video[0]; if (embeds_video != null && embeds_video.length < 1) { embeds_video = window.frames[player_id].document.getElementsByTagName('object'); embed_video = embeds_video[0]; } var final_height = parseInt(embed_video.height); var final_width = parseInt(embed_video.width); // SPECIAL Custom values to adjust margin around the video. if (navigator.appName=='Microsoft Internet Explorer') { final_height += 28; final_width += 24; } else { final_height += 17; final_width += 17; } document.getElementById(player_id).height = final_height; document.getElementById(player_id).width = final_width; //alert(' ' + embed_video + ' ' + final_height + ' ' + final_width); }