/*



*/
function ir_selectmenu(menuarray, forminitarray, selectinittext)
{
	this.menuarray = menuarray;
	this.forminitarray = forminitarray;
	this.selectinittext = selectinittext;
	this.selecttext = new Array();
	this.formarray = new Array();
	this.formarray_init = false;
	this.formarray_ok = true;
	this.currelem = null;
	this.checkformarray = ir_selectmenu_checkformarray;
	this.update = ir_selectmenu_update;
	this.init = ir_selectmenu_init_by_index;
	this.init_by_index = ir_selectmenu_init_by_index;
	this.init_by_value = ir_selectmenu_init_by_value;
}

function ir_selectmenu_checkformarray()
{
	var selecttext;
	if (this.formarray_init == false)
	{
		for (i = 0; i < this.forminitarray.length; i++)
		{
			if (document.forms[this.forminitarray[i][0]] && document.forms[this.forminitarray[i][0]].elements[this.forminitarray[i][1]])
			{
				this.formarray[i] = document.forms[this.forminitarray[i][0]].elements[this.forminitarray[i][1]];
			}
			if (!this.formarray[i] || this.formarray[i].type != 'select-one')
			{
				this.formarray_ok = false;
			}
		}
		if (this.formarray.length != this.forminitarray.length)
		{
			this.formarray_ok = false;
		}
		this.formarray_init = true;
		for (i = 0; i < this.formarray.length; i++)
		{
			selecttext = (typeof(this.selectinittext) == 'object' ? this.selectinittext[i] : this.selectinittext);
			this.selecttext[i] = selecttext ? selecttext : 'Please select';
		}
	}
	return this.formarray_ok;
}

function ir_selectmenu_update(element, initarray)
{
	if (this.checkformarray() == false)
	{
		return false;
	}
	
	var element_idx = -1;
	var currelem_idx;
	var fillarray = this.menuarray;
	if (!initarray || !initarray.length)
	{
		initarray = new Array();
	}
	var initval;
	
	for (currelem_idx = 0; currelem_idx < this.formarray.length; currelem_idx++)
	{
		this.currelem = this.formarray[currelem_idx];
		if (element == this.currelem)
		{
			element_idx = currelem_idx;
		}
		if ((element_idx >= 0 && currelem_idx >= element_idx + 1) || (this.currelem == element && initarray.length > 0))
		{
			for (var counter = this.currelem.options.length - 1; counter >= 0; counter--)
			{
				this.currelem.options[counter] = null;
			}
			if (fillarray)
			{
				this.currelem.options[0] = new Option(this.selecttext[currelem_idx], '');
				for (i = 0; i < fillarray.length; i++)
				{
					this.currelem.options[i+1] = new Option(fillarray[i][0], fillarray[i][1]);
				}
				if (currelem_idx - element_idx >= 0 && initarray.length > 0)
				{
					initval = parseInt(initarray.shift());
					if (initval >= 0 && initval < this.currelem.options.length-1)
					{
						this.currelem.selectedIndex = initval + 1;
					}
				}
			}
			else
			{
				this.currelem.options[0] = new Option('------------------', '');
			}
		}
		if (fillarray && this.currelem.selectedIndex-1 >= 0 && fillarray[this.currelem.selectedIndex-1] && fillarray[this.currelem.selectedIndex-1][2].length > 0)
		{
			fillarray = fillarray[this.currelem.selectedIndex-1][2];
		}
		else
		{
			fillarray = null;
		}
	}
	return true;
}

function ir_selectmenu_init_by_index(initarray_index)
{
	if (this.checkformarray() == false)
	{
		return false;
	}
	
	if (!initarray_index || !initarray_index.length)
	{
		initarray_index = new Array('-1');
	}
	return this.update(this.formarray[0], initarray_index);
}

function ir_selectmenu_init_by_value(initarray_value)
{
	var initarray_index = new Array();
	var index;
	var fillarray = this.menuarray;
	for (level = 0; level < initarray_value.length; level++)
	{
		index = -1;
		if (fillarray)
		{
			for (i = 0; i < fillarray.length; i++)
			{
				if (fillarray[i][1] == initarray_value[level])
				{
					index = i;
				}
			}
			if (index >= 0)
			{
				initarray_index[level] = index;
				fillarray = fillarray[index][2];
			}
			else
			{
				fillarray = null;
			}
		}
	}
	this.init_by_index(initarray_index);
	return true;
}

function ir_rating_request(form)
{
	form = $(form);
	if (form.find('.checkbox:checked').length == 0)
	{
		alert('Please select an option');
	}
	else
	{
		form.find(':button').each( function() { if (typeof this.disabled != 'undefined') { this.disabled = true; } } );

		try
		{
			form.load('/en/ajax/cw_ajax_rating_en_43857.html', form.serializeArray());
		}
		catch (e)
		{
		}

	}
	return false;
}
<!-- Created with InterRed V9.x, http://www.interred.de/, by InterRed GmbH -->
<!-- BID: 19124, iBID: 28343, CID: 40025, iCID: 151983 -->
<!-- Link: $(LB19124)$ $(LC40025:#PHP-Includes)$ -->
<!-- Generiert: 2012-01-14 18:29:49 -->

