

var restore = new Array();
function imgOver(whichImage, newSrc)
{
    restore[whichImage] = whichImage.src;
    whichImage.src = newSrc;
}

function imgOut(whichImage)
{
    whichImage.src = restore[whichImage];
}

function bookmarksite(title, url)
{
    if (document.all)
        window.external.AddFavorite(url, title);
    else if (window.sidebar)
        window.sidebar.addPanel(title, url, "");
}

function ClipBoard() 
{
    holdtext.innerText = copytext.innerText;
    Copied = holdtext.createTextRange();
    Copied.execCommand("Copy");
    alert("Affiliate code copied!");
}

function runOffice2k3()
{
    movie = window.open('/flash/instructions/image_links/office_2003/InsertingImageLinksIntoEmails_2003.swf','myWindow','width=700,height=550 toolbar=0,location=0,scrollbars=0,status=0,resizable=0,fullscreen=0,menubar=0');
}
function runOffice2k7()
{
    movie = window.open('/flash/instructions/image_links/office_2007/Image_Links_in_Emails.swf','myWindow','width=700,height=550 toolbar=0,location=0,scrollbars=0,status=0,resizable=0,fullscreen=0,menubar=0');
}

function openNewWindow(URLtoOpen, windowName, windowFeatures)
{
	newWindow=window.open(URLtoOpen, windowName, windowFeatures);
	if (window.focus)
	{
		newWindow.focus();
	}
}

function getFlashMovieObject(movieName)
{
    if (window.document[movieName]) 
    {
        return window.document[movieName];
    }
    if (navigator.appName.indexOf("Microsoft Internet")==-1)
    {
        if (document.embeds && document.embeds[movieName])
            return document.embeds[movieName]; 
    }
    else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
    {
        return document.getElementById(movieName);
    }
}

function changeiFrame(framename)
{
    document.getElementById(framename).src = "Flash/blank.htm";
}

//function stopFlash(moviename)
//{
//     var flashObj = getFlashMovieObject(moviename)
//     flashObj.TStopPlay("flash/CSjobs.swf")
//}

function playFlash(moviename)
{
    var flashObj = getFlashMovieObject(moviename);
    document.getElementById('movie').Play();
}     

// Show Popup.
function showPopUp(id)
{
    var divId =document.getElementById(id);
    divId.style.visibility = "visible";
    divId.focus();
}

function showPopUpFlash(id, iframename, videosrc)
{
    var divId =document.getElementById(id);
    divId.style.visibility = "visible";
    divId.focus();

    document.getElementById(iframename).src = videosrc;
}

function closePopUp(id)
{
    document.getElementById(id).style.visibility = "hidden";
}

function closePopUpFlash(id, iFrameName)
{   
    changeiFrame(iFrameName);
    document.getElementById(id).style.visibility = "hidden";
}

var mouseover=true;
var objname;

//Gets coords of popup
function coordinates(objName)
{
    moveMe = document.getElementById(objName);
	mouseover=true;
	pleft=moveMe.style.pixelLeft;
	ptop=moveMe.style.pixelTop;
	xcoor=event.clientX;
	ycoor=event.clientY;
    objname = objName;
	document.onmousemove = moveImage;
}

//moves popup
function moveImage()
{
    objmove = document.getElementById(objname);
    if (mouseover&&event.button==1)
	{
	    objmove.style.pixelLeft=pleft+event.clientX-xcoor;
	    objmove.style.pixelTop=ptop+event.clientY-ycoor;
	    return false;
    }
}

//mouse off popup
function mouseup()
{
    mouseover=false;
}

 function Cover(bottom, top, ignoreSize) {
                var location = Sys.UI.DomElement.getLocation(bottom);
                top.style.position = 'absolute';
                top.style.top = location.y + 'px';
                top.style.left = location.x + 'px';
                if (!ignoreSize) {
                    top.style.height = bottom.offsetHeight + 'px';
                    top.style.width = bottom.offsetWidth + 'px';
                }
            }

function findPos(strobj)
{
    obj = document.getElementById(strobj);
    var curtop = 0, curleft = 0;
    if(obj.offsetParent)
    {
        while(1)
        {
            curtop += obj.offsetTop;
            curleft += obj.offsetLeft;
            if(!obj.offsetParent)
                break;
            obj = obj.offsetParent;
        }
    }
    else if(obj.y)
    {
        curtop += obj.y;
        curleft += obj.x;
    }

    return {X: curleft, Y: curtop};
}

function findPosY(strobj)
{
    obj = document.getElementById(strobj);
    var curtop = 0;
    if(obj.offsetParent)
    {
        while(1)
        {
            curtop += obj.offsetTop;
            if(!obj.offsetParent)
                break;
            obj = obj.offsetParent;
        }
    }
    else if(obj.y)
        curtop += obj.y;

    return curtop;
}

function findPosX(strobj)
{
    obj = document.getElementById(strobj);
    var curleft = 0;
    if(obj.offsetParent)
    {
        while(1)
        {
            curleft += obj.offsetLeft;
            if(!obj.offsetParent)
                break;
            obj = obj.offsetParent;
        }
    }
    else if(obj.x)
        curleft += obj.x;

    return curleft;
}

function GetScreenHeight()
{
    if (self.innerHeight) // all except Explorer
    {
        innerH = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
    {
        innerH = document.documentElement.clientHeight;
    }
    else if (document.body) // other Explorers
    {
        innerH = document.body.clientHeight;
    }
    
    return innerH;
}

function GetPageHeight()
{
    var test1 = document.body.scrollHeight;
    var test2 = document.body.offsetHeight
    if (test1 > test2)	// all but Explorer Mac
    {
	    pageH = document.body.scrollHeight;
    }
    else			// Explorer Mac    would also work in Explorer 6 Strict, Mozilla and Safari
    {
	    PageH = document.body.offsetHeight;
    }
    
    return PageH;
}

function add_flash()
{
document.writeln("<object data=\"OpenMovies.swf\" type=\"application/x-shockwave-flash\" width=\"700\" height=\"265\""+
            "id=\"myMovieName\">"+
            "<param name=\"allowScriptAccess\" value=\"sameDomain\" />"+
            "<param name=\"movie\" value=\"OpenMovies.swf\" />"+
            "<param name=\"quality\" value=\"high\" />"+
            "<param name=\"bgcolor\" value=\"#FFFFFF\" />"+
            "<param name=\"wmode\" value=\"transparent\" />"+
         "</object>");
}