var tdOn = 0;
function changeBg(t,bg)
{
        t.style.background = bg;
}

function popWin( url, name, width, height, scroller )
{
        var outStr = 'height=' + height + ',width=' + width;
        if (!scroller)
        {
                outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no';
        }
        else
        {
                outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no';
        }
                window.open(url, name, outStr);
}
function go(url)
{
	location.replace(url);
}

function jumpTo()
{
	f = document.goHereForm;
	idx = f.goHere.selectedIndex;
	v = f.goHere.options[idx].value;
        location.replace(v);
}

function loadSelect(f_name,select_name,val)
{                               
        var the_one = eval('document.'+f_name+'.'+select_name);
        for(x=0;x < the_one.length;x++)
        {

           if (the_one.options[x].value == val)
            {
                 the_one.options.selectedIndex = x
                 the_one.options[x].selected = true;
                 break;
            }
        
        }       
                
        the_one = "";
}

function closeOut()
{

	if(window.opener)
	{
        	window.opener.location = "https://server.publishers-mgmt.com/abi/abiOrder.php?ppref=promo";
        	window.close();
	}
	else
	{
        	document.location = "https://server.publishers-mgmt.com/abi/abiOrder.php?ppref=promo";
	}

 
}

function openYahoo(symbol)
{
	url = 'http://finance.yahoo.com/q?s='+ symbol;
        window.open(url);
}
function formatCC(num)
{
num = num.toString().replace(/-|\s/g,'');
if(isNaN(num)) num = "";
return (num);
}
function openImage(i,w,h)
{
   var win     = null;
   var winName = 'dImage';
   var page    = 'dImage2.php?i='+i;
   var w       = w + 30;
   var h       = h + 30;
   var leftPosition = (screen.width) ? (screen.width-w)/2 : 0;
   var topPosition  = (screen.height) ? (screen.height-h)/2 : 0;

   if(screen.width==800)
   {
      settings = 'height='+h+',width='+w+',top=0,left=0,scrollbars=yes,noresible'
      win      = window.open(page,winName,settings);
   }
   else
   {
      settings = 'height='+h+',width='+w+',top='+topPosition+',left='+leftPosition+',scrollbars=no,noresible'
      win      = window.open(page,winName,settings);
   }
}
