﻿function OpenUrl(newLocation) {
    window.parent.location.href = newLocation;
}

function MouseOverPlay() {
    document.getElementById('playButton').style.backgroundImage = "url(img/play_button_hover.png)";
}

function MouseOutPlay() {
    document.getElementById('playButton').style.backgroundImage = "url(img/play_button.png)";
}

function ShowSWFObject(fileUrl) {
    var flashVars_swfObject = {
        file: fileUrl
        ,
        autostart: 'true'
        ,
        width: '675'
        ,
        download: 'http://www.oovoo.com/Download.aspx'
        ,
        moreinfo: 'http://www.oovoo.com/How-to-oovoo.aspx'
    };
    var params_swfObject = {
};
var attributes_swfObject = {
};
swfobject.embedSWF('include/flvplayer.swf', 'swfObject_swfContent', '675', '380', '7.0', '', flashVars_swfObject, params_swfObject, attributes_swfObject);
}

function showFlash() {
    document.getElementById('flashContainer').style.display = '';
    document.getElementById('imageContainer').style.display = 'none';
}

function hideFlash() {
    document.getElementById('flashContainer').style.display = 'none';
    document.getElementById('imageContainer').style.display = '';
}

function CloseFlashPlayer() {

    hideFlash();
}

var content = document.getElementById('t_content');
if (content) {
    content.dir = 'ltr';
}

function TrackStart() {
    pageTracker._trackPageview('website/video/howvideochat/start');
}

function TrackTenSec() {
    pageTracker._trackPageview('website/video/howvideochat/10sec');
}

function TrackEnd() {
    pageTracker._trackPageview('website/video/howvideochat/end');
}



function querySt(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i = 0; i < gy.length; i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
            return ft[1];
        }
    }
}


function SetPageContentHeight() {
    var pname = querySt("pname");

    var currHeight = $("#t_content").height();

    if (pname == "HowToooVooSocialNetworking") {
        $("#t_content").css("height", currHeight + 80);

        if (pageLanguage == "de" || pageLanguage == "fr") {
            $("#t_content").css("height", currHeight + 130);        
        }
    }
}


function SetSpacingForDownloadButton() {

    if (pageLanguage != "en") {

        if ($("#download_btn div").length) {
            
            //if not en padding left
            $("#download_btn div").css("padding-left", "20px");

            //if fr or de make font size smaller
            if (pageLanguage == "fr" || pageLanguage == "de") {
            
                $("#download_btn div").css("font-size", "13px");
            }
        }
    }
}

function HideInviteLinkWhenMac() {

    if (navigator.appVersion.toLowerCase().indexOf("win") != -1) {
        //if mac, hide the invite link : HowToooVooItem.aspx?pname=HowToooVooInvite
        $("#InviteFriendCmd").css("display", "block");
    }
    else {
        $("#InviteFriendCmd").css("display", "none");
    }
}

$(document).ready(function () {

    try {

        HideInviteLinkWhenMac();

        SetPageContentHeight();

        SetSpacingForDownloadButton();

        jQuery.each(jQuery.browser, function (i, val) {

            //if ie 7 or running in ie 7 doc mode
            if ((i == "msie" && jQuery.browser.version.substr(0, 3) == "7.0") || document.documentMode == "7") {

                $("#divSwitchToFull").css("padding-top", "190px");

            }
            else {
                $("#divSwitchToFull").css("padding-top", "210px");

                //for how to in hebrow and arabic, download button 
                $("#spnBr").html("<br/><br/><br/>");
            }
        });

    }
    catch (ex) { }
});






