var centering = 'yes';
var run = 0;

/**
 * Suchergebniszeile hervorheben
 * Sucht nach einem Element mit der ID 'rowXXX'
 *
 * @param rowKey String des Zeilenschluessels
 * @param classname CSS Style (Optional)
 */
function highlightRow(row) {	
	if (row) { row.className = "resultRowHighlight"; }
}

/**
 * Suchergebniszeile hervorheben rueckgaengig machen
 * Sucht nach einem Element mit der ID 'rowXXX'
 *
 * @param rowKey String des Zeilenschluessels
 */
function unHighlightRow(row) {	
	if (row) { row.className = "resultRowData"; }
}

function showSideGradient()
{
	var rightSide = document.getElementById("rightSide");
	var leftSide = document.getElementById("leftSide");	
	
	if (document.all) 
	{
		leftSide.className = "leftSideIe";
		rightSide.className = "rightSideIe";		
	}
	else
	{
		leftSide.className = "leftSideMoz";
		rightSide.className = "rightSideMoz";		
	}
}


/**
 * Stellt das div mit der Information "Ihre Anfrage wird bearbeitet" dar
 *
 * Erforderliches HTML-Element: <div id="progressing">...</div>
 */

function progressing() {

	var gp = document.getElementById("glassplate");
	var p = document.getElementById("progressing");
	if (p) {
	 
		p.style.display = "block";
	}
	
	if (gp) {
	 
		gp.style.display = "block";
	}
	setTimeout("stopProgressing()",22000);	
}


function stopProgressing() {
	var p = document.getElementById("progressing");
	var gp = document.getElementById("glassplate");
	if (p) {
		p.style.display = "none";
	}
	if (gp) {
	 
		gp.style.display = "none";
	}
}

function markColor(position,count)
{
	
	
	for (var i = 0; i <count;i++)
	{
		var aTag = document.getElementById('colorRepeater.' + i + '.colorAction');
		
		if (i != position)
		{
			aTag.childNodes[0].className="colorfield";	
		}
		else
		{
			aTag.childNodes[0].className="colorfield Selected";	
		}
		
	}	
}

function markCushion(position,count)
{
	
	
	for (var i = 0; i <count;i++)
	{
		var aTag = document.getElementById('chosenCushion.cushionRepeater.' + i + '.cushionAction');
		
		if (i != position)
		{
			aTag.childNodes[0].className="cushionfield";	
		}
		else
		{
			aTag.childNodes[0].className="cushionfield Selected";	
		}
		
	}	
}


function setInitialWidgetValues(carmake, model, carbody) 
{
	document.getElementById('initialCarmakeId').value=carmake;
	document.getElementById('initialModelId').value=model;
	document.getElementById('initialCarbodyId').value=carbody;
}

function confirmIt(text)
{
	
	var answer = confirm(text);	
	if (answer == false)
	{
		stopProgressing();
	}	
	return answer;
	
}

function checkResolution()
{		
	var screenResWidth = screen.width;	
	var screenResHeight = screen.height;
	
	if(screenResWidth <= "1024" || screenResHeight<= "800") 
	{
		var contentArea = document.getElementById('contentArea');	
		var div1 = document.getElementById('rightShadow');
		var div2 = document.getElementById('bottomShadow');
		var div3 = document.getElementById('backgroundStrip');	
	
		contentArea.className = "contentAreaLowRes";
		div1.className = "";
		div2.className = "";
		div3.className = "";		
	}

}


