/*
* Plugins JS scripts
/*/
function changeAttributesPrice( ){
  var fPriceAdd = 0;
  var aSelects = gEBI( 'attributes' ).getElementsByTagName( 'select' );
  for( var i = 0; i < aSelects.length; i++ ){
    var aSelect = aSelects[i];
    if( aSelect.className == 'attributes' ){
      var aSelectValue = aSelect.options[aSelect.options.selectedIndex].value;
      if( aSelectValue != '' )
        var aAttribute = aSelectValue.split( "|" );
      else
        var aAttribute = Array( 0, 0 );
      if( aAttribute[1] != '' ){
        fPriceAdd += ( generatePrice( fPrice, aAttribute[1] ) - fPrice );
      }
    }
  } // end for
  gEBI( 'priceValue' ).innerHTML = changePriceFormat( fix( fPrice * 1 + fPriceAdd ) * fEuroValue);
  fPriceLukas = fix( (fPrice * 1 + fPriceAdd ) * fEuroValue);
  if (fPriceLukas>=lukas_min_amount && fPriceLukas<=lukas_max_amount) { 
	gEBI('lukas').style.display = "block";
	gEBI('lukas_na').style.display = "none";
	gEBI('lukasA').onclick = "windowNew( 'lukas.php?PARAM_TARGET=simulator&PARAM_CREDIT_AMOUNT="+fPriceLukas+"', 900, 500, 'Lukas' )";
  }
  else {
	gEBI('lukas').style.display = "none";
	gEBI('lukas_na').style.display = "block";
  }
} // end function changeAttributesPrice

function windowNew( sAdres, iWidth, iHeight, sTitle, iReturn ){
  if ( !sTitle )
    sTitle = '';
  if( !iReturn )
    iReturn = false;

	if( !iWidth )
		var iWidth = 850;
	if( !iHeight )
		var iHeight = 560;

	if( +iWidth > 850 )
		iWidth = 850;
	else
		iWidth = +iWidth + 60;

	if( +iHeight > 560 )
		iHeight = 560
	else
		iHeight = +iHeight + 60;

	var iX = ( screen.availWidth - iWidth ) / 2;
	var iY = ( screen.availHeight - iHeight ) / 2;

  var refOpen = window.open( sAdres, sTitle, "height="+iHeight+",width="+iWidth+",top="+iY+",left="+iX+",resizable=yes,scrollbars=yes,status=0;" );

  if( iReturn == true )
  	return refOpen
}
