var anzFeedDesign = 0;
var anzFeedAktu = 0;
var anzFeedQuali = 0;
var anzFeedGeschw = 0;
var anzFeedInhalt = 0;
var anzFeedUebersicht = 0;
var okFeedCaptcha = false;
function feedReload()
{
	var aktiv = window.setInterval('feedbackShowDiv("div_trFoot")', 3000);
	//window.clearInterval(aktiv);
}
function loadFrmFeedback()
{
	ftOpenOverlay();
	ftSetPOContent('<div style="width:528px;height:300px;background-image:url('+ gFeedbackWaitImg +');background-repeat:no-repeat;background-position:center center;">&nbsp;</div>');
	ftShowPOContent();
	
	var lURL = '/SCR/INC/Form/loadFeedback.asp?Lasid='+gFeedbackLASID+'&katid='+gFeedbackKatID+'&poolid='+gFeedbackPoolID;
	new AjaxRequest(lURL,function(sText){
	ftSetPOContent(sText);
	});
	anzFeedDesign = 0;
	anzFeedAktu = 0;
	anzFeedQuali = 0;
	anzFeedGeschw = 0;
	anzFeedInhalt = 0;
	anzFeedUebersicht = 0;
	okFeedCaptcha = false;
}
function feedbackChange(starBez,starID)
{
	var xi,delAll,setNull,tempStarEmpty;
	delAll = false;
		
	if(starBez=='design')
	{
		if (anzFeedDesign==starID)
		{
		    if (starID > (anzFeedDesign-1))
            {
                ge(starBez+'_'+starID).src=gFeedbackStarBorder;
                delAll = true;
            }
            else
            {
	            ge(starBez+'_'+starID).src=gFeedbackStarEmpty;
	        }
	        
			starID = starID - 1;
		}
		else
		{
			delAll = true;
		}
		anzFeedDesign = starID;
	}
	if(starBez=='quali')
	{
		if (anzFeedQuali==starID)
		{
			if (starID > (anzFeedQuali-1))
            {
                ge(starBez+'_'+starID).src=gFeedbackStarBorder;
                delAll = true;
            }
            else
            {
	            ge(starBez+'_'+starID).src=gFeedbackStarEmpty;
	        }
			starID = starID - 1;
		}
		else
		{
			delAll = true;
		}
		anzFeedQuali = starID;
	}
	if(starBez=='aktu')
	{
		if (anzFeedAktu==starID)
		{
			if (starID > (anzFeedAktu-1))
            {
                ge(starBez+'_'+starID).src=gFeedbackStarBorder;
                delAll = true;
            }
            else
            {
	            ge(starBez+'_'+starID).src=gFeedbackStarEmpty;
	        }
			starID = starID - 1;
		}
		else
		{
			delAll = true;
		}
		anzFeedAktu = starID;
	}
	if(starBez=='geschw')
	{
		if (anzFeedGeschw==starID)
		{
			if (starID > (anzFeedGeschw-1))
            {
                ge(starBez+'_'+starID).src=gFeedbackStarBorder;
                delAll = true;
            }
            else
            {
	            ge(starBez+'_'+starID).src=gFeedbackStarEmpty;
	        }
			starID = starID - 1;
		}
		else
		{
			delAll = true;
		}
		anzFeedGeschw = starID;
	}
	if(starBez=='inhalt')
	{
		if (anzFeedInhalt==starID)
		{
			if (starID > (anzFeedInhalt-1))
            {
                ge(starBez+'_'+starID).src=gFeedbackStarBorder;
                delAll = true;
            }
            else
            {
	            ge(starBez+'_'+starID).src=gFeedbackStarEmpty;
	        }
			starID = starID - 1;
		}
		else
		{
			delAll = true;
		}
		anzFeedInhalt = starID;
	}
	if(starBez=='ueber')
	{
		if (anzFeedUebersicht==starID)
		{
			if (starID > (anzFeedUebersicht-1))
            {
                ge(starBez+'_'+starID).src=gFeedbackStarBorder;
                delAll = true;
            }
            else
            {
	            ge(starBez+'_'+starID).src=gFeedbackStarEmpty;
	        }
			starID = starID - 1;
		}
		else
		{
			delAll = true;
		}
		anzFeedUebersicht = starID;
	}
	tempStarEmpty
	
	if(starID != 0)
	{
	    tempStarEmpty = gFeedbackStarBorder;
	}
	else
	{
	    tempStarEmpty = gFeedbackStarEmpty;
	}
	
	if(delAll==true)
	{
		for (xi=1;xi<=5;xi++)
		{
			if (ge(starBez+'_'+xi))
			{
				ge(starBez+'_'+xi).src=tempStarEmpty;
			}
		}
	}
	if(starID != 0)
	{
		for (xi=1;xi<=starID;xi++)
		{
			if (ge(starBez+'_'+xi))
			{
				ge(starBez+'_'+xi).src=gFeedbackStarFull;
			}
		}
	}
	sendFeedbackTest();
}

function sendFeedbackTest()
{
	if(okFeedCaptcha == true && (anzFeedDesign>0 || anzFeedAktu>0 || anzFeedQuali>0 || anzFeedGeschw>0 || anzFeedInhalt>0 || anzFeedUebersicht>0 || ge('feedKommentar').value!= ''))
	{
		ge('frmFeedbacksend').src = gFeedbackSend;
		ge('frmFeedbacksend').onclick = function(){sendFeedback();};
		ge('frmFeedbacksend').style.cursor='pointer';
	}
	else
	{
		ge('frmFeedbacksend').src = gFeedbackSend_i;
		ge('frmFeedbacksend').onclick = '';
		ge('frmFeedbacksend').style.cursor='';
	}
}

function sendFeedback()
{
	var lURL = '/SCR/INC/Form/loadFeedback.asp?Lasid='+gFeedbackLASID+'&katid='+gFeedbackKatID+'&poolid='+gFeedbackPoolID;
	lURL = lURL + '&fkom='+escape(ge('feedKommentar').value);
	lURL = lURL + '&femail='+escape(ge('feedEmail').value);
	lURL = lURL + '&fname='+escape(ge('feedName').value)+'&feedSave=1';
	lURL = lURL + '&fdesign='+anzFeedDesign+'&fgeschw='+anzFeedGeschw;
	lURL = lURL + '&fquali='+anzFeedQuali+'&faktu='+anzFeedAktu;
	lURL = lURL + '&finhalt='+anzFeedInhalt+'&fueber='+anzFeedUebersicht;
	new AjaxRequest(lURL,function(sText){
	ftSetPOContent(sText);
	window.setTimeout("ftCloseOverlay()", 2000);
	});
}
function feedCheckCaptcha(el)
{
if (el.value.length<=5)
	new AjaxRequest('/SCR/INC/POOL/LOGIN/chkCapt.asp?LASID=' + gFeedbackLASID + '&logRegCaptcha='+ge('txtFeedCaptcha').value, feedCheckCaptchaRet);
}
function feedCheckCaptchaRet(lRet)
{
	if (lRet=='Pass') 
	{
		ge('imgFeedCaptcha').src=gFeedbackCheckPos;
		ge('imgFeedCaptcha').setAttribute('capStatus',true)
		okFeedCaptcha = true;
	}
	else
	{
		ge('imgFeedCaptcha').src=gFeedbackCheckNeg;
		ge('imgFeedCaptcha').setAttribute('capStatus',false)
		okFeedCaptcha = false;
	}
	sendFeedbackTest()
}
function feedbackShowDiv(posDiv)
{
	var objDiff=eval(ge(posDiv));
	
	//alert('gesamt '+anzahl+' aktiv '+anzahl_aktiv);
	//alert (sXmlSuchID)
	ge('div_FootFeedback').style.top = (getTop(objDiff)-87)+'px';
	ge('div_FootFeedback').style.left = (getLeft(objDiff)+253)+'px';
	ge('div_FootFeedback').style.display = '';
}
