$(document).ready(function(){
    // for fancybox gallery
    $('a[rel=gallery_group]').fancybox({
        'transitionIn'	: 'elastic',
	'transitionOut'	: 'elastic',
        'titlePosition' : 'over'
    });
    
});

/*
 *	This will make the string 2 digits
 *
 *	@param		_number		number to make into 2 digits
 *
 *	@return		A two digit number
*/   
function MakeTwoDigits( _num )
{
    var m_return = '0';
    
    if( ( _num.length == 0 ) ) // double zero
        m_return = '00';
    else if( _num.length == 1 )
        m_return = _num + '0';
    else
        m_return = _num;
    
    return m_return;
} // MakeTwoDigits

/*
 *	This will create the price value to Canadian format

 *	@param		_number		number to make into a price
 *
 *	@return		$###,###.##, ex: $987,654.32
*/  
function FormatPrice( _number )
{
    var m_return = 0; // return this value
    
    if( _number >= 0 ) // create the pricing for this
    {
        m_return = Math.round(_number*100)/100;
        var m_arrPrice = m_return.toString().split('.');
        
        var m_strTmp = m_arrPrice[0];
        var m_strPrice = '';
        
        while( m_strTmp.length>3 ) // add a separater for thousands
        {
            m_strPrice = ',' + m_strTmp.substr(m_strTmp.length-3,3) + m_strPrice;
            m_strTmp = m_strTmp.substr(0, m_strTmp.length-3);
        } // while
        
        var m_strDecimal = ( m_arrPrice.length == 1 ) ? '00' : MakeTwoDigits(m_arrPrice[1]);
        
        m_return = '$' + m_strTmp + m_strPrice + '.' + m_strDecimal; 
    }
    else // make 0 the default
        m_return = '0.00';
    
    return m_return;
} // FormatPrice
