﻿function VideoPlayerPopUp(URL)
{
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=980,height=700,left = 1,top = 1');");
}

/*****************************************
Returns the first X number of words from the 
string
*****************************************/
function wordCap(strValue, numWords) {
    var matches = strValue.match(/\s/g);
    if(matches && matches.length) {
        if((matches.length + 1) <= numWords)
            return strValue;
        else {
            var words = strValue.split(/\s/g);
            var str = '';
            for(var i=0;i<numWords;i++) {
                str += words[i] +' ';
            }
               
            return str;
        }            
    }
    else
        return strValue;
}


function fbs_click()
{
    u=location.href;
    t=document.title;
    window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
    return false;
}