﻿
function ToggleCategoryDiv( id, imageid )
{
    if( document.getElementById(id).style.display == "none" )
	{
		document.getElementById(imageid).src = "Images/minimizeblue.gif";
		document.getElementById(imageid).alt = "minimize";
		//document.getElementById(listid).style.display = "block";
		new Effect.Appear( id, {duration: .5} );
	}
	else
	{
		document.getElementById(imageid).src = "Images/maximizeblue.gif";
		document.getElementById(imageid).alt = "maximize";
		//document.getElementById(listid).style.display = "none";
		new Effect.Fade( id, {duration: .5} );
	}
}

function ToggleCategory( listid, imageid )
{
    if( document.getElementById(listid).style.display == "none" )
	{
		document.getElementById(imageid).src = "Images/minimize.gif";
		document.getElementById(imageid).alt = "minimize";
		//document.getElementById(listid).style.display = "block";
		new Effect.BlindDown( listid, {duration: 1} );
	}
	else
	{
		document.getElementById(imageid).src = "Images/maximize.gif";
		document.getElementById(imageid).alt = "maximize";
		//document.getElementById(listid).style.display = "none";
		new Effect.BlindUp( listid, {duration: 1} );
	}
}

function ClearText(thefield)
{
	if( thefield.defaultValue == thefield.value )
	    thefield.value = "";
}

function PhoneImageOnload(phonedropdownid)
{
    // only swap image if something is selected in phone model dropdown
    if( document.getElementById(phonedropdownid).selectedIndex >= 0 && document.getElementById(phonedropdownid).options[document.getElementById(phonedropdownid).selectedIndex].value != "0" )
    {
        var phoneid = document.getElementById(phonedropdownid).options[document.getElementById(phonedropdownid).selectedIndex].value;
        document.getElementById("thePhonePhoto").src = "Images/phones/" + phoneid.toString() + ".jpg";
        new Effect.Appear( "thePhonePhoto", {duration: .5} );
    }
}

function swapPhoneImage(phoneid)
{
    if( phoneid != "0" )
    {
        document.getElementById("thePhonePhoto").style.display = "none";
        document.getElementById("thePhoneIndicator").style.display = "block";
        
        document.getElementById("thePhonePhoto").src = "Images/phones/" + phoneid.toString() + ".jpg";
        
        
        document.getElementById("thePhoneIndicator").style.display = "none";
        new Effect.Appear( "thePhonePhoto", {duration: .5} );
    }
    else
    {
        document.getElementById("thePhonePhoto").style.display = "none";
    }
}

function writeTonePlayer(productid)
{
    document.write('<object id="toneplayer' + productid + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100" height="16" id="tonePlayer" align="middle" VIEWASTEXT>');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<param name=FlashVars VALUE="progressBarColor=0x58858e&stripesColor=0x99bcc2&loaderbgColor=0x000000&loaderborderhighlightColor=0xcccccc&loaderborderlowlightColor=0x666666&needleColor=0xFFFFFF&shadowColor=black" />');
    document.write('<param name="movie" value="http://toneroom.uscellular.com/flash/trPlayer.swf?productID=' + productid + '"/>');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<param name="bgcolor" value="#000000" />');
    document.write('<embed src="http://toneroom.uscellular.com/flash/trPlayer.swf?productID=' + productid + '" FlashVars="progressBarColor=0x58858e&stripesColor=0x99bcc2&loaderbgColor=0x000000&loaderborderhighlightColor=0xcccccc&loaderborderlowlightColor=0x666666&needleColor=0xFFFFFF&shadowColor=black" quality="high" wmode="transparent" bgcolor="#000000" width="100" height="16" name="tonePlayer" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>');
    document.write('</object>');
}

//var currentPlayerId = "";

//function setCurrentPlayer(id)
//{
//	currentPlayerId = id;
//}

//function stopCurrentPlayer()
//{
//    if( currentPlayerId != undefined && currentPlayerId != "" )
//    {
//		
//        //if (document.getElementById(currentPlayerId).Play)
//	        document.getElementById(currentPlayerId).StopPlay();
//	    //else
//	    //    alert("oops");
//	}    
//}