function configureCar(marketId)
{
    /* For new CC inner size is important, but gotoUrlNewWinSizeByName() calcs outer size */
    var sWidth = 980;
    var sHeight = 680;
    sWidth -= g_is_ie ? 15 : 20;
    sHeight -= 25;

    if(marketId=='zh') {
      sUrl='http://cc.porsche.com/icc_euro/ui/pva/index.jsp?sprache=cn';
    } else {
      sUrl='http://cc.porsche.com/icc_euro/ui/pva/index.jsp?sprache=ce&market=PACCE';
    }

    gotoUrlNewWinSizeByName(sUrl, sWidth, sHeight, "PVA");
}

function compareCar(marketId)
{
    /* For new CC inner size is important, but gotoUrlNewWinSizeByName() calcs outer size */
    var sWidth = 980;
    var sHeight = 680;
    sWidth -= g_is_ie ? 15 : 20;
    sHeight -= 25;

    if(marketId=='zh') {
      sUrl='http://cc.porsche.com/cm_06/compareModel.do?language=cn&modelYear=3';
    } else {
      sUrl='http://cc.porsche.com/cm_06/compareModel.do?language=en&modelYear=3';
    }
	
    gotoUrlNewWinSizeByName(sUrl, sWidth, sHeight, "PVA");
}

function getScreenXYUrlParam()
{
    var clientWidth = screen.width;
    var clientHeight = screen.height;
    return '&screen='+clientWidth+'x'+clientHeight;
}

function gotoUrlNewWinSizeByName(s, sWidth, sHeight, sName)
{
    sWidth += g_is_ie ? 15 : 20;
    sHeight += 25;
    newWin = window.open(s, sName, "width=" + sWidth + ",height=" + sHeight + ",left=40,top=40,dependent=yes,location=no,resizable=no,scrollbars=no,status=no");
}

//==============================================================================
// Expandable content areas
//============================================================================== 
function getExpandables()
{
  return YAHOO.util.Dom.getElementsByClassName('expandable');
}
function isExpanded(el)
{
  return YAHOO.util.Dom.hasClass(el, 'expanded');
}
function fnExHighlight(e)
{
  var expandables=getExpandables();
  YAHOO.util.Dom.removeClass(expandables, 'active');
  YAHOO.util.Dom.addClass(this, 'active');
}
function fnExUnhighlight(e)
{
  YAHOO.util.Dom.removeClass(this, 'active');
}
function fnExClick(e)
{
  if(isExpanded(this))
  {
    YAHOO.util.Dom.removeClass(this, 'expanded');
  }
  else
  {
    YAHOO.util.Dom.addClass(this, 'expanded');
  }
}
function initSwitches()
{
  var expandables=getExpandables();
  YAHOO.util.Event.addListener(expandables, "mouseover", fnExHighlight);
  YAHOO.util.Event.addListener(expandables, "mouseout", fnExUnhighlight);
  YAHOO.util.Event.addListener(expandables, "click", fnExClick);
}
//------------------------------------------------------------------------------


//==============================================================================
// External links
//==============================================================================
function initExternal()
{
  var externals=YAHOO.util.Dom.getElementsByClassName('external');
  for(i=0,j=externals.length; i<j; i++)
    externals[i].target="_blank";
}
//------------------------------------------------------------------------------


//==============================================================================
// Landing page popups
//============================================================================== 
function popupAppearAt(elementId, x, y)
{
  YAHOO.util.Dom.setStyle(elementId, 'display', 'block');
  YAHOO.util.Dom.setStyle(elementId, 'left', x+'px');
  YAHOO.util.Dom.setStyle(elementId, 'top', y+'px');
}
function popupDisappear(elementId)
{
  YAHOO.util.Dom.setStyle(elementId, 'display', 'none');
}
//------------------------------------------------------------------------------


//==============================================================================
// JS Gimmick init
//============================================================================== 
function initAll()
{
  initSwitches();
  initExternal();
}

YAHOO.util.Event.onDOMReady(initAll);
//------------------------------------------------------------------------------
