function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

/*
* mehrere Models in Sedcard auswählen
*/
var SelectModel = ',';

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function addModel(id) {
	MM_openBrWindow('myfactory/addfavorite.php?mdid='+id,'AddModel','left=200,top=20;scrollbars=yes,resizable=yes,width=275,height=650');
}

function selectModel(id,checked) {
	var pos = SelectModel.indexOf(','+id+',');
	if (checked && pos==-1) {
		SelectModel += id+',';
	}
	if (!checked && pos>-1) {
		var pos2=SelectModel.indexOf(',',pos+1);
		SelectModel=SelectModel.substr(0,pos)+SelectModel.substr(pos2,SelectModel.length);
	}
	//alert(SelectModel);
}

function submitLeuchtkasten() {
	if (SelectModel==',') {
		alert('Es wurden keine Bilder ausgewählt. Wählen Sie welche aus.');
		return;
	}
	MM_openBrWindow('myfactory/addleuchtkasten.php?select='+SelectModel,'AddLeuchtkasten','left=200,top=20;scrollbars=yes,resizable=yes,width=275,height=650');
}

function submitPrint() {
	if (SelectModel==',') {
		alert('Es wurden keine Bilder ausgewählt. Wählen Sie welche aus.');
		return;
	}
	MM_openBrWindow('myfactory/addprint.php?select='+SelectModel,'AddPrint','left=200,top=20;scrollbars=yes,resizable=yes,width=275,height=650');
}
