function openSimpleWindow (url)
{
	window.open(url,'MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=600,height=500'); 
	return false;
}

function openSimpleWindow (url, height, width)
{
	window.open(url,'MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=' + width +',height=' + height); 
	return false;
}

var newWin = null; 
function openSimpleWindow(strURL, strType, strHeight, strWidth) { 

 if (newWin != null && !newWin.closed) 
   newWin.close(); 
 var strOptions=""; 
 if (strType=="console") 
   strOptions="resizable,scrollbars,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixed") 
   strOptions="status,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="elastic") 
   strOptions="toolbar,menubar,scrollbars,"+ 
     "resizable,location,height="+ 
     strHeight+",width="+strWidth; 
 newWin = window.open(strURL, 'newWin', strOptions); 
 newWin.focus(); 
}

// See http://www.sitepoint.com/article/perfect-pop-up

// example: <a href="my-pop-up-window.htm"  onclick="popUp(this.href,'console',400,200);return false;"  target="_blank">This is my link</a>




function num2money(anynum) 
{   
	//-- Returns passed number as string in $xxx,xxx.xx format.   
	workNum=Math.abs((Math.round(anynum*100)/100));
	workStr=""+workNum ;  
	if (workStr.indexOf(".")==-1){workStr+=".00"};   
	dStr=workStr.substr(0,workStr.indexOf("."));
	dNum=dStr-0;   
	pStr=workStr.substr(workStr.indexOf("."));   
	while (pStr.length<3)
		{pStr+="0";}   
	//--- Adds comma in thousands place.   
	if (dNum>=1000) {      
		dLen=dStr.length;     
		dStr=parseInt(""+(dNum/1000))+","+dStr.substring(dLen-3,dLen);   
	}   
	//-- Adds comma in millions place.   
	if (dNum>=1000000) {      
		dLen=dStr.length;      
		dStr=parseInt(""+(dNum/1000000))+","+dStr.substring(dLen-7,dLen);   
	}   //-- Adds comma in billions place.   
	if (dNum>=1000000000) {      
		dLen=dStr.length;      
		dStr=parseInt(""+(dNum/1000000000))+","+dStr.substring(dLen-11,dLen);   
	}   
	retval = "$" + dStr + pStr;
	if (anynum<0) {      
		retval="-"+retval;   
	}   
	return retval;
	}



	
	
function DefaultButton(e, buttonid){ 

  var evt = e ? e : window.event;

  var bt = document.getElementById(buttonid);

  if (bt){ 

      if (evt.keyCode == 13){ 

            bt.click(); 

            return false; 

      } 

  } 

}




