function $$(nElementId)
{
	return document.getElementById(nElementId);
}

function str_repeat ( input, multiplier ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // *     example 1: str_repeat('-=', 10);
    // *     returns 1: '-=-=-=-=-=-=-=-=-=-='


    return new Array(multiplier+1).join(input);
}

function flushCal(btn){
	var trs = btn.parentNode;
	var trs2, trs3;
	var idSuffix = Math.round(Math.random()*1000);

	trs2 = trs.getElementsByTagName('input');
	trs2[0].id = 'input_date_' + idSuffix;

	//alert(trs2[0].id)

	trs3 = trs.getElementsByTagName('button');
	trs3[0].id = 'button_date_' + idSuffix;

	Calendar.setup({
        inputField     :    trs2[0].id,
        ifFormat       :    "%Y-%m-%d",
        showsTime      :    false,
        button         :    trs3[0].id,
        singleClick    :    false,
        step           :    1
    });

    return true;
	//alert(document.getElementById('ewfewfesf'))
}

function flushCal2(btn){
	var trs = btn.parentNode;
	var trs2, trs3;
	var idSuffix = Math.round(Math.random()*1000);

	trs2 = trs.getElementsByTagName('input');
	trs2[0].id = 'input_date_' + idSuffix;

	//alert(trs2[0].id)

	trs3 = trs.getElementsByTagName('button');
	trs3[0].id = 'button_date_' + idSuffix;

	Calendar.setup({
        inputField     :    trs2[0].id,
        ifFormat       :    "%Y-%m-%d %H:%M:00",
        showsTime      :    true,
        button         :    trs3[0].id,
        singleClick    :    false,
        step           :    1
    });

    return true;
	//alert(document.getElementById('ewfewfesf'))
}