﻿//Image rollover
//image filenames must be in the format 'filename.ext' and 'filename-on.ext'

Rollover = function()
{
	//empty constructor
}

//Static function turns on the rollover image
Rollover.turnOn = function(element)
{
	//Get the image element
	var img = element;

	//Get the filename portion minus the extension
	var filename = img.src.substr(0, img.src.lastIndexOf('.'));

	//Get the extension portion
	var extension = img.src.substr(img.src.length - 4, 4);

	//insert '-on' between the filename and extension and set it as the new src
	img.src = filename + '-on' + extension;
}

//Static function turns off the rollover image
Rollover.turnOff = function(element)
{
	// //Get the image element
	var img = element;

	//Get the filename portion minus the extension, also removed the '-on'
	var filename = img.src.substr(0, img.src.lastIndexOf('.') - 3);

	//Get the extension portion
	var extension = img.src.substr(img.src.length - 4, 4);

	//Set the combined name as the new img src
	img.src = filename + extension;
}

Popup = function()
{
	//empty constructor
}

Popup.showWindow = function(url, width, height)
{
	window.open(url, 'demo', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height);
}

function popArrow()
{
    var funcArgs = new Array;
    funcArgs = popArrow.arguments;
    //alert(funcArgs.length);
    if(funcArgs.length > 0)
    {
        Rollover.turnOn(funcArgs[0]);
    }
    for (i=0; i< 3; i++)
    {
        //alert(strArrowOver + i);
        if(i == funcArgs[1])
        {
            document.getElementById('arrow' + i).style.display = 'block';
        }        
                
    }
}

function hideArrow()
{
    var funcArgs2 = new Array;
    funcArgs2 = hideArrow.arguments;
    if(funcArgs2.length > 0)
        Rollover.turnOff(funcArgs2[0]);
        
    for (i=0; i< 3; i++)
    {
        if(i == funcArgs2[1])
        {
            document.getElementById('arrow' + i).style.display = 'none';
        }
    }        
}