/*************************************************
class: system
modified: 2003.03.17
project: Cunamis
version: 5.1
author: Audrius Naslenas, audrius@metasite.net
All rights reserved
*************************************************/
var onload_events=new Array();
var home_url="";
var lang="";
 
function loading(){
 var m=onload_events;
 for(i=0;i<m.length;i++){eval(m[i]);}
}
function onloading(s){
	onload_events[onload_events.length]=s;
}
function pop(url,name,width,height){
	if (url=='') {return;}
	if (name=='') name='';
	if (!(width>0)) width=300;
	if (!(height>0)) height=200;
	url=home_url+url;
	var a=window.open(url,name,"toolbar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height);
	a.focus();
}
function popimage(ifile,ix,iy,ititle,stop) { 
  var win;
  var sWidth;
  var sHeight;
  var NS = (document.layers) ? 1 : 0;
  win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
  win.document.open();
  win.document.write("<html><head><title>"+ititle+"</title>");
  win.document.write("</head><body>");
  win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
  win.document.write("<img src="+ifile+"></div></body></html>");
  win.document.close();
  if (NS) {
    sWidth = win.innerWidth;
    sHeight = win.innerHeight;
  } else {
    sWidth = win.document.body.clientWidth;
    sHeight = win.document.body.clientHeight;
  }
  if(stop!=true && (sWidth!=ix || sHeight!=iy)) {
    win.close();
    setTimeout("popimage('"+ifile+"',"+ix+","+iy+",'"+ititle+"',true)", 250);
    return;
  }
  win.focus();
}
function load_editor(url){
	var width=600;
	var height=540;
	url=home_url+url;
	var weditor=window.open(url,'wineditor',"toolbar=no,scrollbars=yes,resizable=no,width="+width+",height="+height);
	weditor.focus();
}
