function getHelp() {
	xPos=(screen.width/2)-(600/2); yPos=(screen.height/2)-(400/2);
	window.open('../inc/hlpText.php','TextHelp','width=600,height=400,left=' + xPos +',top=' + yPos +'status=no,menubar=no,scrollbars=yes,resizable=no');
}

function getTextHelp() {
	xPos=(screen.width/2)-(600/2); yPos=(screen.height/2)-(400/2);
	window.open('../inc/hlpText_user.php','TextHelp','width=600,height=400,left=' + xPos +',top=' + yPos +'status=no,menubar=no,scrollbars=yes,resizable=no');
}

function expand( spi ) {
 img = 'img'+spi; si = 'crm'+spi;
 displayType = ( document.getElementById( si ).style.display == 'none' ) ? 'block' : 'none';
 document.getElementById( si ).style.display = displayType;
 if (document.getElementById( img ))	
 	(displayType=='block') ? document.getElementById( img ).src = '/docs/graphigs/icons/collapse.gif' : document.getElementById( img ).src = '/docs/graphigs/icons/expand.gif';
}

function expandTG( spi ) {
 si = 'crm'+spi;
 displayType = ( document.getElementById( si ).style.display == 'none' ) ? 'block' : 'none';
 document.getElementById( si ).style.display = displayType;
}

function showPic(dir,usr,img, w, h) {
	var stru = usr.toString();
	if (dir==0 || dir==2 || dir==3) { 
		if (usr=="preview")
			var link = img;
		else
			var link = img.substring( 0, img.lastIndexOf('/') ) + "/large" + img.substring( img.lastIndexOf('/'), img.length );
	} else if (dir==1) {
		var link = "../upload/images/user/_" + stru.toString().substring(  stru.length -1 , stru.length ) + "/" + stru + "_" + img + "_0.jpg";
	} else { 
		var link = "../images/nopic.gif"; 
	}
	
	var name = "zoom";
	popImage(link,name);
}

function openIt(page,w,h,titel,srl) {
	xPos=screen.width/2-(w/2);
	yPos=screen.height/2-(h/2);
	window.open(page,titel,"width="+w+",height="+h+",top="+yPos+",left="+xPos+",scrollbars="+srl);
}

 var winFeatures = "toolbar=yes,"
	             + "location=yes,"
	             + "status=yes,"
	             + "menubar=yes,"
	             + "scrollbars=yes,"
	             + "resizable=yes,"
	             + "directories=yes,"
	             + "width=1024,"
	             + "height=748,"
	             + "top=0,"
	             + "left=0";

function expandNP( spi ) {
	si = 'crm'+spi;
	displayType = ( document.getElementById( si ).style.display == 'none' ) ? 'block' : 'none';
	document.getElementById( si ).style.display = displayType;
}

// PopUps

PositionX = 20;
PositionY = 20;

defaultWidth  = 100;
defaultHeight = 100;


var AutoClose = false;

if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}

var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=100,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
	if (isNN){imgWin=window.open('about:blank','puw',optNN);}
	if (isIE){imgWin=window.open('about:blank','puw',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
		writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');
		writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');
		writeln('if (isIE){');
		writeln('window.resizeTo(100,100);');		
		writeln('width=document.getElementById("PopImage").width;');
		writeln('height=document.getElementById("PopImage").height;');
		writeln('window.resizeTo(width+10,height+80);}');
		//writeln('window.resizeTo(100,100);');
		//writeln('width=100-(document.body.clientWidth-document.getElementById("PopImage").width);');
		//writeln('height=100-(document.body.clientHeight-document.getElementById("PopImage").height);');
		//writeln('window.resizeTo(width+12,height+0);}');
		writeln('if (isNN){');
		writeln('width=document.getElementById("PopImage").width;');
		writeln('height=document.getElementById("PopImage").height;');
		writeln('window.resizeTo(width+5,height+54);}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');
		writeln('function alertImgW(){alert(document.getElementById("PopImage").width);}');
		writeln('</sc'+'ript>');
		if (!AutoClose) writeln('</head><body style="background:#000; padding:0; margin:0" scroll="no" onload="reSizeToImage();doTitle();self.focus();">');
		else writeln('</head><body style="background:#000" scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
		writeln('<img name="PopImage" id="PopImage" src='+imageURL+' style="display:block; cursor:pointer" title="Klicken um zu schließen" onclick="javasc'+'ript:window.close()" galleryimg="no" oncontextmenu="return false"></body></html>');
		close();		
	}
}

// eoPopUps