function writeLegalFooter() {
	var legalContainer = document.getElementById('legalCopy');
    legalContainer.innerHTML = '<p>Contact lenses, even if worn for cosmetic reasons, are medical devices that must only be worn under the prescription, direction and supervision of an eye care professional. Serious eye health problems may occur as a result of sharing contact lenses.</p><p>The opinions expressed on this site are the opinions of the individuals who post them and may not reflect the opinions of CIBA VISION&reg; Corporation "CIBA VISION" or any of its employees or affiliates.</p><p>Any communication or material you transmit to this page by electronic mail or otherwise, including any data, questions, comments, suggestions or the like is, and will be treated as, nonconfidential and nonproprietary. Anything you transmit or post becomes the property of CIBA VISION or its affiliates and may be used for any purpose, including, but not limited to, reproduction, disclosure, transmission, publication, broadcast and posting.</p><p>Comments sent to this page may not be posted in real time. In addition it is possible that some comments will not be posted to this site.</p><p>You may receive a response from CIBA VISION if you submit a comment or message to this page reporting an adverse event experienced while using a CIBA VISION product. You may receive such a responsive message even if your comment or message is not posted to this page. <a href="http://creative.myspacecdn.com/Client/FocusDailies/FreshLooksRfsh/Downloads/disclaimer.html" target="_blank" name="&lid=readmoreRules">Click to read more.</a></p>';	
}

var win = null;
var index = 1;
function openDialog(id,w,h) {
    Dialog.alert($(id).innerHTML, {className: "alphacube",  width:w, height:h, id: "d" + index})
    index++;
	//document.getElementById('videoHidder').style.display = 'none';
}

function lastDialog(id) {
    Dialog.confirm($(id).innerHTML, {className: "alphacube",  width:250, okLabel: "Close All", ok: closeAllModalWindows})
}

function closeAllModalWindows() {
    Windows.closeAllModalWindows();
    //return true;
	//document.getElementById('videoPl').style.display = 'inline';
}


function tabSwap(tabID, closeID){
	var tabContainer = document.getElementById(tabID);
    tabContainer.style.display = 'block';
	var closeContainer = document.getElementById(closeID);
    closeContainer.style.display = 'none';
}


function modelPop(modelName) {
	var bioContainer = document.getElementById('wpHolder');
    bioContainer.innerHTML = '<div align="center"><img src="http://creative.myspace.com/Client/FocusDailies/FreshLooksRfsh/Images/'+ modelName +'Bio.jpg" /></div>';
	openDialog(wallpaperPop, 400, 525);		
}

function populateCode(badgeNumber) {
	var imageFileType = ".jpg";
	var badgeContainer = document.getElementById('badgeCodeArea');	
    badgeContainer.innerHTML = '<form name="badgeForm"><textarea onClick="this.select();" name="badgeText" id="badgeText" value="This text will be copied" style="width:393px; height:75px;"><a href="http://clk.atdmt.com/MSR/go/myspccba0160000137msr/direct/01/"><img src="http://creative.myspace.com/Client/FocusDailies/FreshLooksRfsh/Images/freshlooks_'+ badgeNumber +''+ imageFileType +'" /></a></textarea></form>'; 
}


/**************************************
Video Swap


directions:  
inser the following html:

    <div id="videoPlayerContainer">
        <div id="videoPlayer"></div>
        <div id="videoTextContainer">
            <div id="videoTextHeader"></div>
                <span>Video URL:</span><input type="text" id="textVideoUrl" />
                <span>Embed Code:</span><input type="text" id="textVideoCode" />
        </div>
    </div>
    <a href="javascript:void(0);" onclick="OnVideoClick(12345, 'text for video 1');">video 1</a>
    <a href="javascript:void(0);" onclick="OnVideoClick(123456, 'text for video 2');">video 2</a>
    <a href="javascript:void(0);" onclick="OnVideoClick(123453, 'text for video 3');">video 3</a>


and then trigger the video switch by making a call to OnVideoClick('2023434112', 'cheese') with the 
corresponding video id and caption to be placed in the header text.
***************************************/
var defaultWidth = 340;
var defaultHeight = 230;

// loads the video player and then changes the text.
// width and height are optional
function OnVideoClick(videoId, headerText, width, height)
{
    LoadVideo(videoId, width, height);
    LoadVideoText(videoId, headerText);
}

// loads the video player
// width and height are optional
function LoadVideo(videoId, width, height)
{
    // if the width and height have been specified, we set it.
    // otherwise we use the default width and height that are defined above
    width = (width) ? width : defaultWidth;
    height = (height) ? height : defaultHeight;
    
    // change the video source   
    var videoPlayerContainer = document.getElementById('videoPlayer');
    videoPlayerContainer.innerHTML = '<embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m=' + videoId + ',t=1,mt=video,ap=1,sr=0" width="340" height="230" allowFullScreen="true" type="application/x-shockwave-flash" wmode="opaque"></embed>';
    

}

// sets the text header, video url, and video embed code.
function LoadVideoText(videoId, videoText)
{
    document.getElementById('videoTextHeader').innerHTML = videoText;
    document.getElementById('textVideoUrl').value = 'http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=' + videoId;
    document.getElementById('textVideoCode').value = '<embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m=' + videoId + ',t=1,mt=video,ap=1,sr=0" width="340" height="230" allowFullScreen="true" type="application/x-shockwave-flash" wmode="opaque"></embed>';
}





