
function SymError()
{
	return true;
}
window.onerror = SymError;


function jsmsg(msg)
{
	jQuery.blockUI({message: msg}); 
	setTimeout(jQuery.unblockUI, 2000); 
	setTimeout("window.close()",2000);
}

function MediaPool(typ, target,elem) {
  var winWidth = 950;
  var winHeight = 650;
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	
  elem = (!elem) ? '1' : elem;
  var w = (screen.width - winWidth)/2;
  var h = (screen.height - winHeight)/2 - 60;
  var url = '?nosource=1&pop=1&do=browser&typ=' + typ + '&mode=fck&target=' + target + '&elemid=' + elem;
 // var url = 'mediapool.php?typ=' + typ + '&target=' + target;
  var name = 'mpool';
  var features = 'scrollbars=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
  window.open(url,name,features);
}

var Fenster = null;
function popup(meineSeite,meinName,w,h,scroll,lo,tb)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	rez = (lo) ? lo : 1;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+rez+'';
	Fenster = window.open(meineSeite,meinName,settings);
}

var Focus = null;
function winfocus()
{
	Focus = window.moveTo(0,0);
	//window.focus();
}

function openWin(URL,w,h,scrollbars)
{
	scrolls = 1;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrollbars+',resizable';
	Fenster = window.open(URL + '&noframes=1','',settings)
}

function openOrder(URL)
{
	window.open(''+ URL +'&pop=1','EDIT','left=0,top=0,width=950,height=750,scrollbars=1,resizable=0');
}

function openStpricesWin(URL)
{
	var w = (screen.width);
	var h = (screen.height);
	window.open(''+ URL +'&pop=1','EDIT','left=0,top=0,width=950,height=750,scrollbars=1,resizable=1');
}

function openArticle(URL)
{
	var w = (screen.width);
	var h = (screen.height);
	window.open(''+ URL +'&pop=1','EDIT','left=0,top=0,width=950,height=750,scrollbars=1,resizable=1');
}




function openVariantWin(URL)
{
	var w = (screen.width);
	var h = (screen.height);
	window.open(''+ URL +'&pop=1','EDIT','left=0,top=0,width=950,height=750,scrollbars=1,resizable=1');
}

function print_content(id)
{
	var html = document.getElementById(id).innerHTML;
	// html = html.replace(/src="/gi, 'src="../' );
	html = html.replace(/&lt;/gi, '<' );
	html = html.replace(/&gt;/gi, '>' );
	var pFenster = window.open( '', null, 'height=600,width=780,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes' ) ;
	var HTML = '<html><head></head><body style="font-family:arial,verdana;font-size:12px" onload="window.print();">' + html + '</body></html>' ;
	pFenster.document.write(HTML);
	pFenster.document.close();
}


var ie  = document.all  ? 1 : 0;
 function selall(kselect) {
   	var fmobj = document.ihform;
   	for (var i=0;i<fmobj.elements.length;i++) {
   		var e = fmobj.elements[i];
   		if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled)) {
   			e.checked = fmobj.allbox.checked;
   			
   		}
   	}
   }
   function CheckCheckAll(kselect) {
   	var fmobj = document.kform;
   	var TotalBoxes = 0;
   	var TotalOn = 0;
   	for (var i=0;i<fmobj.elements.length;i++) {
   		var e = fmobj.elements[i];
   		if ((e.name != 'allbox') && (e.type=='checkbox')) {
   			TotalBoxes++;
   			if (e.checked) {
   				TotalOn++;
   			}
   		}
   	}
   	if (TotalBoxes==TotalOn) {fmobj.allbox.checked=true;}
   	else {fmobj.allbox.checked=false;}
   }
   function select_read() {
   	var fmobj = document.kform;
   	for (var i=0;i<fmobj.elements.length;i++) {
   		var e = fmobj.elements[i];
   		if ((e.type=='hidden') && (e.value == 1) && (! isNaN(e.name) ))
   		{
   			eval("fmobj.msgid_" + e.name + ".checked=true;");
   			
   		}
   	}
   }
   function desel() {
   	var fmobj = document.uactions;
   	for (var i=0;i<fmobj.elements.length;i++) {
   		var e = fmobj.elements[i];
   		if (e.type=='checkbox') {
   			e.checked=false;
   			
   		}
   	}
   }
