function swapImg(id, src) 
{
	var img;
	
	if(img = document.getElementById(id))
	{ 
	    img.src = src;
    }
}

function setApplication(link_href, image_src) 
{
	var link_element;
	var image_element;
	var product_box;

	if( (link_element = document.getElementById('UsesProductLink')) && (image_element = document.getElementById('UsesProductImage')) ) 
	{
		link_element.href = link_href;
		image_element.src = image_src;

		product_box = document.getElementById('UsesProductBox');

		product_box.style.backgroundImage = 'url(../images/uses/displayPage/productGlowBac.jpg)';
	}
}

function showFaq(divID)
{
    var iCurrent = document.getElementById("activeDiv").value;
    var iShim;
    
    if(iCurrent.length <= 1)
    {
        iShim = 0;
    }
    else
    {
           iShim = "";
    } 
    //hide current answer
    document.getElementById("faq" + iCurrent).style.display = "none";
    //reset arrow
    document.getElementById("faq_" + iCurrent).src = "/images/faq/off/" + iShim + iCurrent + ".gif";
    
    //show this answer
    document.getElementById("faq" + divID).style.display = "inline";
            
    //store active
    document.getElementById("activeDiv").value = divID;
}

function swapFAQ(id, src) 
{
	var img;
	var iCurrent = document.getElementById("activeDiv").value;
	var sTemp = id.split("_");
	
	if(img = document.getElementById(id))
	{ 
	    if(sTemp[1] != iCurrent)
	    {
	        img.src = src;
        }
    }
}

function popWin(url, width, height, name) 
{

	xPos = (screen.width / 2) - (width / 2);
	yPos = (screen.height / 2) - (height / 2);

	attr	= 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,'
			+ 'width=' + width + ','
			+ 'height=' + height + ','
			+ 'left=' + xPos + ',' 
			+ 'top=' + yPos;

	var win = window.open(url, name, attr);
	win.focus();
}

//js<-->as calls
function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	//return (isIE) ? window[movieName] : document[movieName];
	return document[movieName];
}

function callToActionscript(flash, str) 
{
    //debugger;
    var myflash = getFlashMovie(flash);
	myflash.sendToActionscript(str);
}

function sendToJavaScript(val)
{
	//document.getElementById('boxX').value = val;
}

