/***************************************************************\
|                                                               |
|                   apexx CMS & Portalsystem                    |
|                 ============================                  |
|             (c) Copyright 2005, Christian Scheb               |
|                  http://www.stylemotion.de                    |
|                                                               |
|---------------------------------------------------------------|
| DO NOT REMOVE ANY COPYRIGHTS WITHOUT PERMISSION!              |
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/


//***************** POPUP SMILIES ******************
function showsmilies(subdir) {
	if ( subdir=='undefined' || subdir==null ) subdir='';
	fenster = window.open(subdir+"misc.php?action=smilies","showsmilies","toolbar=no,scrollbars=yes,resizable=yes,width=320,height=450");
	fenster.focus();
}


//***************** POPUP CODES ******************
function showcodes(subdir) {
	if ( subdir=='undefined' || subdir==null ) subdir='';
	fenster = window.open(subdir+"misc.php?action=codes","showcodes","toolbar=no,resizable=yes,scrollbars=yes,width=450,height=350");
	fenster.focus();
}

//***************** POPUP WINDOW ******************
function popupwin(url,width,height,resizeable,center) {
	wincount=ran_number=Math.round(Math.random()*10000);
	
	//Standardwerte
	if ( center=='' || center=='undefined' || center==null ) center=1;
	if ( resizeable=='' || resizeable=='undefined' || resizeable==null ) resizeable=0;
	
	//Resizeable
	if ( resizeable!=0 ) resizeable='yes';
	
	//Zentrieren
	if ( center!=0 && center!='' && center!=null ) {
		var positionx=(screen.availWidth-width)/2;
		var positiony=(screen.availHeight-height)/2;
		fenster = window.open(url,"popwin"+wincount,"toolbar=no,resizable="+resizeable+",scrollbars="+resizeable+",width="+width+",height="+height+",screenx="+positionx+",screeny="+positiony+",left="+positionx+",top="+positiony);
	}
	
	//Nicht zentrieren
	else {
		fenster = window.open(url,"popwin"+wincount,"Toolbar=no,resizable=yes,scrollbars=yes,width="+width+",height="+height);
	}

fenster.focus();
}
