﻿// v1.0
function openwindow(url) {
    window.open(url, 'interstitial', 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=490,height=400');
}

function openprintable(url) {
    window.open(url, '_blank', 'scrollbars=yes,resizable=yes,width=800,height=600');
}

// v2.0
function MM_openBrWindow_(theURL, winName, features) {
    window.open(theURL, winName, features);
}

function openDisclaimer(url) {
    MM_openBrWindow_(applicationRoot + '/LeavingNotice.aspx?url=' + url, 'winDisclaimer', 'width=400,height=300');
}

function createCookie(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var expires = "; expires=" + date.toGMTString();
    }
    else var expires = "";
    document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');

    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
}

function eraseCookie(name) {
    createCookie(name, "", -1);
}


function thisMovie(movieName) {
	 if (navigator.appName.indexOf("Microsoft") != -1) {
		 return document.getElementById(movieName);//window[movieName];
	 } else {
		 return document[movieName];
	 }
}
function playVideo()
{
	thisMovie("videoHomePage").playVideo();
}
function resumeVideo()
{
	thisMovie("videoHomePage").resumeVideo();
}
function pauseVideo()
{
	thisMovie("videoHomePage").pauseVideo();
}
function stopVideo()
{
	thisMovie("videoHomePage").stopVideo();
}
function seekVideo(offset)
{
	thisMovie("videoHomePage").seekVideo(offset);
}
function setVideoVolume(level)
{
	thisMovie("videoHomePage").setVideoVolume(level);
}
function fullScreenVideo()
{
	thisMovie("videoHomePage").fullScreenVideo();
}
function loadVideoById(id)
{
	thisMovie("videoHomePage").loadVideoById(id);
}
function loadVideoPlayList(stringArray)
{
	thisMovie("videoHomePage").loadVideoPlayList(stringArray);
}
function goToVideoChapter(videoId, chapterId)
{
	thisMovie("videoHomePage").goToChapter(videoId, chapterId);
}
function videoOnLoad(id) {	
}
function videoOnPlay(id) {	
}
function videoOnStop(id) {	
}

function callFloodlight_new(catId) {
    var tag_url="http://fls.doubleclick.net/activityi;src=2644366;type=niasp995;cat="+catId+";ord="+Math.floor(Math.random()*999999)+"?";
    if (document.getElementById("DCLK_FLDiv")) { var flDiv = document.getElementById("DCLK_FLDiv"); }
    else { var flDiv = document.body.appendChild(document.createElement("div")); flDiv.id = "DCLK_FLDiv"; flDiv.style.display = "none"; }
    var DCLK_FLIframe = document.createElement("iframe");
    DCLK_FLIframe.id = "DCLK_FLIframe_" + Math.floor(Math.random() * 999999);
    DCLK_FLIframe.src = tag_url;
    flDiv.appendChild(DCLK_FLIframe);
}

