
HTTP_GET_VARS=new Array();
strGET=document.location.search.substr(1,document.location.search.length);
if(strGET!='')
    {
    gArr=strGET.split('&');
    for(i=0;i<gArr.length;++i)
        {
        v='';vArr=gArr[i].split('=');
        if(vArr.length>1){v=vArr[1];}
        HTTP_GET_VARS[unescape(vArr[0])]=unescape(v);
        }
    }

function get(v)
{
if(!HTTP_GET_VARS[v]){return 'undefined';}
return HTTP_GET_VARS[v];
}

function popup(url, title, width, height) {
window.open( url, title, "status = 1, height = "+height+", width = "+width+", resizable = 0" )
}

function toggleAddTable(id) {
var e = document.getElementById(id);
        if(e.style.display == 'block') {
            e.style.display = 'none';
        }
        else {
            e.style.display = 'block';
        }


}

function formHelpPopup(form_id, thename) {
 fenster = window.open('../../form_help_popup.php?form_id=' + form_id + '&name=' + thename, "", "width=300,height=200,status=no,scrollbars=no,resizable=no");
 fenster.focus();
}

function showErrorPopup(title, text, confirm_button) {
	Fadein('disable_div',300);
	document.getElementById('warning_popup').style.display = 'block';
	document.getElementById('warning_title').innerHTML = title;
	document.getElementById('warning_text').innerHTML = text;
	document.getElementById('warning_popup_confirm').innerHTML = confirm_button;
}

function hideErrorPopup() {
	Fadeout('disable_div',300);
	document.getElementById('warning_popup').style.display = 'none';
}

function performAction(url) {
	hideErrorPopup();
	window.location.href = url;
}


function numericVal(obj)   {

    var tam = obj.value.length;
    var numeric = false;

    for(var i=0;i<tam;i++)

        {
        caracter = obj.value.charCodeAt(i);

        if((caracter >= 40 && caracter <= 57) || caracter == 32)
        numeric = true;
        else

            {
            obj.value=obj.value.substring(0,tam-1);
            numericVal(obj);
        }

    }

}

// sub wizard price ranges
function addPriceRangeIndividuals() {
	document.getElementById('more_fee_ranges').innerHTML = '<tr><td><input type="text" name="age_from_1" id="age_from_1" size="2" /></td><td><input type="text" name="age_to_1" id="age_to_1" size="2" /></td><td><input type="text" name="fee1" id="fee_1" size="4" /></td></tr>';
	
}

function toggleBibRangeCategorySelects(v) {
	if(v == 'Teams') { document.getElementById('category_select_teams').style.display = 'table-row';  document.getElementById('category_select_individuals').style.display = 'none'; }
	
	if(v == 'Individuals') { document.getElementById('category_select_individuals').style.display = 'table-row';  document.getElementById('category_select_teams').style.display = 'none'; }
	
	if(v == '') { document.getElementById('category_select_individuals').style.display = 'none';  document.getElementById('category_select_teams').style.display = 'none'; }
	
}
