var widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86; function BuildVideoFFB1F674B41248B8CB1E6061CB1A1D86() { ff_widget_div = document.getElementById("ff_video_FFB1F674-B412-48B8-CB1E-6061CB1A1D86"); video_key = CheckVal(ff_widget_div.getAttribute("video_key")); vehicle_key = CheckVal(ff_widget_div.getAttribute("vehicle_key")); vehicle_vin = CheckVal(ff_widget_div.getAttribute("vehicle_vin")); width = CheckVal(ff_widget_div.getAttribute("ff_width")); disable_auto_play = CheckVal(ff_widget_div.getAttribute("disable_auto_play")); if( width == '' ) width = '640'; ff_widget_div.style="width:100%;float:left; text-align:center;"; widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86 = document.createElement('iframe'); widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86.frameBorder=0; widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86.width="100%"; //widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86.height="400px"; widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86.id="ff_widget_iframeFFB1F674B41248B8CB1E6061CB1A1D86"; widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86.scrolling="no"; widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86.style.cssText="min-width:320px;max-width:"+width+"px;overflow:hidden"; widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86.align="center" widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86.setAttribute('allowFullScreen', '') widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86.setAttribute("src", '//media.flickfusion.net/videos/basic/player_embedd.php?auto_resize=1&VIN='+vehicle_vin+'&vehicle_fkey='+vehicle_key+'&video_fkey='+video_key+'&disable_auto_play='+disable_auto_play); ff_widget_div.appendChild(widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86); window.addEventListener("message", receiveMessageFFB1F674B41248B8CB1E6061CB1A1D86, false); } function CheckVal(element_val) { if( element_val == null ) element_val = ''; return element_val; } function receiveMessageFFB1F674B41248B8CB1E6061CB1A1D86(event) { if( event !== null && typeof event === 'object' ) { if( event.data !== null && typeof event.data === 'object' ) { if( event.data.action !== null && event.data.action=== 'HEIGHT' ) { widgetIframeFFB1F674B41248B8CB1E6061CB1A1D86.height=event.data.height+"px"; } } } } BuildVideoFFB1F674B41248B8CB1E6061CB1A1D86();