/**
 *	(c) 2006 insign gmbh
 *	written by fs
 *	last change 16.11.2006 [fs]
 *
 *	history:
 *	0.1 16.11.2006  initial version
 **/

topsoftanbieter = Class.create();
topsoftanbieter.instances = new Array();
Object.extend(topsoftanbieter.prototype, {
    initialize: function(anbieter) {
        this.anbieter = anbieter;
        this.detailcontent = '';
        this.productscontent = new Array();
        this.products = new Array();
    },

    setDetail: function () {

        var params = '&objects.anbieterid=' + this.anbieter;
        var url = absCorrect + 'de/cnt_ajax_anbieterdetail.html';
        var myAjax = new Ajax.Updater(
            					{success: 'anbietercontent'},
            					    url,
                					{
                						method: 'get',
                						parameters: params,
                						evalScripts: true
                					});
        this.detailcontent = $('anbietercontent').innerHTML;
        $('anbietercontent').style.display = '';
    },

    setProducts: function (divid) {

        if(this.productscontent[divid] && this.productscontent[divid] != $(divid).innerHTML)
        {
            $(divid).innerHTML = this.productscontent[divid];
        }

    },

    setProduct: function (divid, productid) {

        if (!this.productscontent[divid]) {
            this.productscontent[divid] = $(divid).innerHTML;
        }

        var params = '&objects.produktid=' + productid;
        var url = absCorrect + 'de/cnt_ajax_productdetail.html';
        var myAjax = new Ajax.Updater(
            					{success: divid},
            					    url,
                					{
                						method: 'get',
                						parameters: params,
                						evalScripts: true
                					});

        $('anbietercontent').style.display = '';
    }

})


function showHideProdKriterien(fieldID)
{
	if ($('boxproduktbereich-'+fieldID).style.display == 'none')
	{
		$('boxproduktbereich-'+fieldID).style.display = '';
		Element.removeClassName('boxbereichtitle-'+fieldID,'boxInactive');
		Element.addClassName('boxbereichtitle-'+fieldID,'boxActive');
		Element.removeClassName('boxfont-'+fieldID,'boxFontInactive');
		Element.addClassName('boxfont-'+fieldID,'boxFontActive');
	}
	else
	{
		$('boxproduktbereich-'+fieldID).style.display = 'none';
		Element.removeClassName('boxfont-'+fieldID,'boxFontActive');
		Element.addClassName('boxfont-'+fieldID,'boxFontInactive');
		Element.removeClassName('boxbereichtitle-'+fieldID,'boxActive');
		Element.addClassName('boxbereichtitle-'+fieldID,'boxInactive');
	}

}

function toggleMusterfirma(mfId)
{
	if ($('musterfirmaDetail_'+mfId).style.display == 'none')
	{
		$('musterfirmaDetail_'+mfId).style.display = '';
		Element.removeClassName('musterfirma_'+mfId,'boxInactive');
		Element.addClassName('musterfirma_'+mfId,'boxActive');
		Element.removeClassName('musterfirmaLabel_'+mfId,'boxFontInactive');
		Element.addClassName('musterfirmaLabel_'+mfId,'boxFontActive');
	}
	else
	{
		$('musterfirmaDetail_'+mfId).style.display = 'none';
		Element.removeClassName('musterfirmaLabel_'+mfId,'boxFontActive');
		Element.addClassName('musterfirmaLabel_'+mfId,'boxFontInactive');
		Element.removeClassName('musterfirma_'+mfId,'boxActive');
		Element.addClassName('musterfirma_'+mfId,'boxInactive');
	}

}