function MM_openBrWindow(theURL,winName,features)
{
	theURL = append_sessionid( theURL );
	OpenWin = window.open(theURL,winName,features);
	OpenWin.opener = self;  OpenWin.focus();
}

function NewColor(obj,bratt,bgcol)
{
	if(obj.style)
	{
		obj.style.border=bratt; //Border-Attribute
		obj.style.backgroundColor=bgcol;
	}
}

function NewColor2(obj,bratt,bgcol)
{
	if(obj.style)
	{
		obj.style.border=bratt; //Border-Attribute
		obj.style.backgroundColor=bgcol;
	}
}

var selected;
var submitter = null;

function submitFunction() {
    submitter = 1;
}
function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

function selectRowEffect(object, buttonSelect) {
  if (!selected) {
    if (document.getElementById) {
      selected = document.getElementById('defaultSelected');
    } else {
      selected = document.all['defaultSelected'];
    }
  }

  if (selected) selected.className = 'moduleRow';
  object.className = 'moduleRowSelected';
  selected = object;

// one button is not an array
  if (document.checkout_payment.payment[0]) {
    document.checkout_payment.payment[buttonSelect].checked=true;
  } else {
    document.checkout_payment.payment.checked=true;
  }
}

function rowOverEffect(object) {
  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
function checkBox(object) {
  document.account_newsletter.elements[object].checked = !document.account_newsletter.elements[object].checked;
}
function popupImageWindow(url) {
  window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
function append_sessionid( theURL )
{
  // SessionID ermitteln und bei Bedarf an URL anhängen
  sessionid = '<?=session_id();?>';
  if( sessionid != "" )
  {
   if( theURL.indexOf("?") == -1 )
   {
    theURL += "?sessionid=" + sessionid;
    }
   else
  {
    theURL += "&sessionid=" + sessionid;
   }
  }

  return theURL;
}