var widgetIframe8BAC15322A7F4407A0B3521C28703A2D; function BuildVideo8BAC15322A7F4407A0B3521C28703A2D() { ff_widget_div = document.getElementById("ff_video_8BAC1532-2A7F-4407-A0B3-521C28703A2D"); 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;"; widgetIframe8BAC15322A7F4407A0B3521C28703A2D = document.createElement('iframe'); widgetIframe8BAC15322A7F4407A0B3521C28703A2D.frameBorder=0; widgetIframe8BAC15322A7F4407A0B3521C28703A2D.width="100%"; //widgetIframe8BAC15322A7F4407A0B3521C28703A2D.height="400px"; widgetIframe8BAC15322A7F4407A0B3521C28703A2D.id="ff_widget_iframe8BAC15322A7F4407A0B3521C28703A2D"; widgetIframe8BAC15322A7F4407A0B3521C28703A2D.scrolling="no"; widgetIframe8BAC15322A7F4407A0B3521C28703A2D.style.cssText="min-width:320px;max-width:"+width+"px;overflow:hidden"; widgetIframe8BAC15322A7F4407A0B3521C28703A2D.align="center" widgetIframe8BAC15322A7F4407A0B3521C28703A2D.setAttribute('allowFullScreen', '') widgetIframe8BAC15322A7F4407A0B3521C28703A2D.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(widgetIframe8BAC15322A7F4407A0B3521C28703A2D); window.addEventListener("message", receiveMessage8BAC15322A7F4407A0B3521C28703A2D, false); } function CheckVal(element_val) { if( element_val == null ) element_val = ''; return element_val; } function receiveMessage8BAC15322A7F4407A0B3521C28703A2D(event) { if( event !== null && typeof event === 'object' ) { if( event.data !== null && typeof event.data === 'object' ) { if( event.data.action !== null && event.data.action=== 'HEIGHT' ) { widgetIframe8BAC15322A7F4407A0B3521C28703A2D.height=event.data.height+"px"; } } } } BuildVideo8BAC15322A7F4407A0B3521C28703A2D();