﻿// utility js functions
// 
// Copyright (c) 2009 Red Deer PCN
// Jing Chen
// 

function setSameHeight(id1, id2)
{
    var col1 = document.getElementById(id1);
    var col2 = document.getElementById(id2);
    
    // get max height
    var height = col1.offsetHeight + "px";
    if (col1.offsetHeight < col2.offsetHeight)
        height = col2.offsetHeight + "px";
    
    // set max height
    col1.style.height = height;
    col2.style.height = height;
}

function swap(clipIdNew) 
{
    // get old clip id
    var eVimeo = document.getElementById("eVimeo");
    var src = eVimeo.src;
    var index1 = src.indexOf("=") + 1;
    var index2 = src.indexOf("&");
    var clipId = src.substring(index1, index2);

    // replace with new clip id
    var pVimeo = document.getElementById("pVimeo");
    pVimeo.innerHTML = pVimeo.innerHTML.replace(clipId, clipIdNew);

    void (0);
}
