/*globals  $$, window, document */

"use strict";

/** This function retrieves the list of div tags in the page and calls the
  * getFootnote function with the list of div tags as input. */

function assembleFootnote() {
    var tagList,
    footnoteNumbering,
    i;
    tagList = [];
    //Retrieving the list of div tags in the page 
    tagList = document.getElementsByTagName("span");

    footnoteNumbering = 0;
    for (i = 0; i < tagList.length; i++) {
        //Check if the id is 'footnote'
        if (tagList[i].getAttribute('id') === 'footnote') {
            // Increment the footnote number and update in the inner HTML
            footnoteNumbering += 1;
            tagList[i].innerHTML = "<sup>" + footnoteNumbering + "</sup>";
		
        }
    }
	
       if(document.getElementById("expandCollapse") !== null) 
         document.getElementById("expandCollapse").innerHTML = '+';
       if (document.getElementById("expandCollapsetext") !== null)
	document.getElementById("expandCollapsetext").style.display = "inline";
}

/* This function takes the div ID's and collapses/expands its content. */

function expandCollapse(disclaimerId, expandCollapseId) {
    var obj,
    col;

    if (document.getElementById("wrapper_Nav") !== null) {
    	document.getElementById("wrapper_Nav").style.height = 1 + 'px';
    } 

    obj = document.getElementById(disclaimerId);
    col = document.getElementById(expandCollapseId);
    

    if (obj.style.display === "none" || obj.style.display === "") {
        obj.style.display = "block";
        col.innerHTML = "- ";
    } else {
        obj.style.display = "none";
        col.innerHTML = "+ ";
    }

	expandLeftNavigation();
}

/* This function is to play video in pop up window . */
function popup(vidpath,w,h,iid) {
	var urlstring = 'http://www.intel.com/en_US/Assets/Video/resources/flash-popup.htm?vid='+vidpath+'&width='+w+'&height='+h;

	if(window.vidwin != undefined)
	{
		vidwin.close();
	}
	vidwin = window.open(urlstring,'win','left=300,top=300,height='+h+',width='+w+',toolbar=0,resizable=0,menubar=0,scrollbars=0,directories=0,status=0,location=0');
}
