

function tab_track(cm_tracking_enabled,id){
	if (cm_tracking_enabled && (id == 'ce_hauptdaten' || id=='ce_on' || id=='ce_techdetails')){
		var cm_id="";
		if (id == 'ce_hauptdaten') cm_id='Hauptmerkmale';
		else
			if (id=='ce_techdetails')cm_id='Technische_Details';
			else
				cm_id='Alle_Details_anzeigen';
		
	    cmCreatePageElementTag(cm_id,"Attribut_Details");
	}
	
}


function maintabs(id,group,path,cm_tracking_enabled,hauptattributename_1,hauptattributename_2){
	var main="";
	var imagetyp1="",imagetype2="";
	var init ="";
	var alldetails="";

	if (id == 'init') {
		init='init';
		if (cm_tracking_enabled )
			cmCreatePageElementTag('Attribute angezeigt',"Attribut_Details");
	}


	
	if (id!='ce_hauptdaten' && id!='init' && group >1){
		imagetyp1=path+'detail-seite_elektronik_2_aus_03.gif';imagetyp2=path+'detail-seite_elektronik_1_an_05.gif';
		if (id=='ce_on' ||( id== 'ce_techdetails' && document.getElementById('prevset').value.indexOf('ce_on') == -1))
			alldetails='<div style=\"padding-left:405px;padding-top:8px;\"><a href=\"#\" onclick=\"ce_attributes(\'ce_off\',\''+hauptattributename_1+'\',\''+ hauptattributename_2+ '\');return false;\">alle Details ausblenden</a></div>';
		else{
			if (checkstate(id) && id != 'ce_off')
				alldetails='<div style=\"padding-left:406px;padding-top:8px;\"><a href=\"#\" onclick=\"ce_attributes(\'ce_off\',\''+hauptattributename_1+'\',\''+ hauptattributename_2+ '\');return false;\">alle Details ausblenden</a></div>';
				
			else
				alldetails='<div style=\"padding-left:421px;padding-top:8px;\"><a href=\"#\" onclick=\"ce_attributes(\'ce_off\',\''+hauptattributename_1+'\',\''+ hauptattributename_2+ '\');return false;\">alle Details ausblenden</a></div>';
		}
		
	}else{
		if (group > 1){
			imagetyp1=path+'detail-seite_elektronik_1_an_03.gif';
			imagetyp2=path+'detail-seite_elektronik_2_aus_05.gif';
		}else{
			imagetyp1=path+'detail-seite_elektronik_1_an_03.gif';
			imagetyp2='';
		}
			
	}
	
	main= '<div class=\"v_bottom_small\"> &nbsp;</div>';
	main=main+'<table id=\"'+init+'\" width=\"545\" cellpadding=\"0\"  cellspacing=\"0\"><tbody><tr><td colspan=\"2\" style=\"padding:0px 0px 0px 0px;margin:0px 0px 0px 0px\">'
	+'<div onClick=\"ce_attributes(\'ce_hauptdaten\',\''+hauptattributename_1+'\',\''+ hauptattributename_2+ '\');return false;\" class=\"f_l\" style=\"cursor:pointer;width:121px;height:31px;background-image:url('+imagetyp1+');\" ><div class=\"v_top_tiny textcenter\"><strong>'+hauptattributename_1+'</strong></div></div>'
	if (hauptattributename_2 != '') {
	main = main + '<div onClick=\"ce_attributes(\'ce_techdetails\',\''+hauptattributename_1+'\',\''+ hauptattributename_2+ '\');return false;\" class=\"f_l\" style=\"cursor:pointer;width:121px;height:31px;background-image:url('+imagetyp2+');\" ><div class=\"v_top_tiny textcenter\"><strong>'+hauptattributename_2+'</strong></div></div>'
	}
	main = main+ '</div>'+alldetails+'</td></tr>';

	return main;
}


function chk_prev(sttitle,prevset){
		
		if (sttitle != null && sttitle != ''){
				if(document.getElementById(sttitle)!= null){
					prevset=prevset+'~'+sttitle+'~';
				}else{
					if(prevset.indexOf('ce_on')== -1)
						prevset='ce_on~'+prevset; 
				}
		
		}
	return prevset;
}


function chk_state(sttitle,state){	
		if (sttitle != null && sttitle != ''){
			if(document.getElementById(sttitle)== null && id !=sttitle){
					state=false;
			}
			if(document.getElementById(sttitle) != null && id == sttitle)
				state=false;
		}
		return state;
}


function setAtts(count,last,name,value,daten){

	if (count < last)
		daten=daten+'<tr><td class=\"no_space_height\" width=\"200\" style=\"border-bottom:1px solid #ebedf2;border-right:1px solid #ebedf2;\"><div style=\"margin-left:2px;\">'+name+'</div></td><td class=\"no_space_height\" width=\"308\" style=\"border-bottom:1px solid #ebedf2;\">'+value+'</td></tr>';
	else
		daten=daten+'<tr><td class=\"no_space_height\" width=\"200\" style=\"border-right:1px solid #ebedf2;\"><div style=\"margin-left:2px;\">'+name+'</div></td><td width=\"308\" class=\"no_space_height\" >'+value+'</td></tr>';
	return daten;
}

function setMainAtts(state,name,value,daten){
			if(state) {tr_color='bgcolor05'; state=false;}else {tr_color='bgcolor11';state=true;}
			var daten=daten+'<tr class=\"'+tr_color+'\">'
			+'<td  class=\"b_style zelle_links no_space_height\"  style=\"width:210px;border-bottom:1px solid #ffffff;border-right:1px solid #ffffff;\">'+name+'</td>'
			+'<td  class=\"b_style zelle_rechts no_space_height\" style=\"border-bottom:1px solid #ffffff;\" >'+value+'</td></tr>'; 	

	return daten;
}

function setGroupAtts(state,idset,sttitle,text,td_image,daten,hauptattributename_1,hauptattributename_2){
		if(state) {tr_color='bgcolor05';}else {tr_color='bgcolor11';}
					
			daten=daten+'<tr id=\"'+idset+'\" class=\"'+tr_color+'\">'
					+'<td class=\"no_space_height\"  width=\"210\" style=\"border-right:1px solid #ffffff;border-bottom:1px solid #ffffff;\">'
					+'<div><a href=\"#\" style=\"text-decoration:none;\" onClick=\"ce_attributes(\''+sttitle+'\',\''+hauptattributename_1+'\',\''+ hauptattributename_2+ '\');return false;\"><img align=\"left\" style=\"margin-top:3px;margin-right:2px;\" src=\"'+td_image+'\"></a></div><div><a href=\"#\" class="consumer" onClick=\"ce_attributes(\''+sttitle+'\',\''+hauptattributename_1+'\',\''+ hauptattributename_2+ '\');return false;\">'+text+'</a></div></td>'
					+'<td class=\"no_space_height\" width=\"320\" style=\"border-bottom:1px solid #ffffff;\">&nbsp;</td></tr>';
		return daten;
}

