var isExpanded = false;

function changeImage(filename, title){
    document.getElementById('product_image_main').src = 'images/products/main/' + filename;
    document.getElementById('product_image_main').alt = title;
    document.getElementById('product_image_main').title = title;
}
function openTab(tab) {
    document.getElementById('tab_0').src= 'images/template/product_btn_full_description.jpg';
    document.getElementById('tab_1').src= 'images/template/product_btn_tech_spec.jpg';
    document.getElementById('tab_2').src= 'images/template/product_btn_video.jpg';
    document.getElementById('product_description_body').style.display = 'none';
    document.getElementById('product_specification_body').style.display = 'none';
    document.getElementById('product_video_body').style.display = 'none';
    document.getElementById('product_description_expand_button').style.display = 'block';
    document.getElementById('expand_button').src= 'images/template/product_btn_expand.jpg';
    
    if (tab == 0) {
        document.getElementById('tab_0').src= 'images/template/product_btn_full_description_active.jpg';
        document.getElementById('product_description_body').style.display = 'block';
        document.getElementById('product_description_body_body').style.display = 'none';
    } else if (tab == 1) {
        document.getElementById('tab_1').src= 'images/template/product_btn_tech_spec_active.jpg';
        document.getElementById('product_specification_body').style.display = 'block';
    } else if (tab == 2) {
        document.getElementById('tab_2').src= 'images/template/product_btn_video_active.jpg';
        document.getElementById('product_video_body').style.display = 'block';
        document.getElementById('product_description_expand_button').style.display = 'none';
        
    } 
}
function InsertFlashVideo(objID, flashLocation, width, height, includeString) {
  var flashObject;
  flashObject = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+width+"' height='"+height+"'>";
  flashObject = flashObject + "<param name='wmode' value='transparent'>";
  flashObject = flashObject + "<param name='movie' value='"+flashLocation+"' />";
  flashObject = flashObject + "<param name='quality' value='high' />";
  if(typeof(includeString) == "undefined") {
    flashObject = flashObject + "<embed src='"+flashLocation+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"' wmode='transparent'";
  } else {
    flashObject = flashObject + "<param name='FlashVars' value='" + includeString + "'";
    flashObject = flashObject + "<embed src='"+flashLocation+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"' wmode='transparent' ";
    flashObject = flashObject + "FlashVars='" + includeString + "'";
  }
  flashObject = flashObject + "></embed></object>";
  if(document.getElementById(objID)) {
    document.getElementById(objID).innerHTML = flashObject;
  }
}
function expand() {
    if (isExpanded) {
        isExpanded = false;
        document.getElementById('product_description_body_body').style.display = 'none';
        document.getElementById('product_specification_body_body').style.display = 'none';
        document.getElementById('expand_button').src= 'images/template/product_btn_expand.jpg';
        document.getElementById('product_description_body_body').focus();
    } else {
        isExpanded = true;
        document.getElementById('product_description_body_body').style.display = 'block';
        document.getElementById('product_specification_body_body').style.display = 'block';
        document.getElementById('expand_button').src= 'images/template/product_btn_collapse.jpg';
        document.getElementById('product_description_body_body').focus();
    }
}
