function new_window(url, win_name){
	win_name=window.open(url,win_name,'toolbar=no,scrollbars=yes,resizable=yes,width=800,height=600,status=no,left=0,top=0,screenX=0,screenY=0')
	win_name.focus()
}

function pic_win(url,wintitle){
	picwin=window.open('image.php?pic='+url+'&name='+wintitle,'picwin','toolbar=no,scrollbars=no,width=620,height=485,left=0,top=0,screenX=0,screenY=0,status=no');
	picwin.focus();
}

function send(to,dep){
	mail=window.open('mail.php?to='+to+'&dep='+dep,'mail','toolbar=yes,scrollbars=yes,width=800,height=480,left=50,top=50,screenX=50,screenY=50,status=no');
	mail.focus();
}

function map_bg(){
	win_name=window.open('image.php?pic=images/map_bg.jpg&name=Map','win_name','toolbar=no,scrollbars=no,width=530,height=370')
	win_name.focus()
}

function map_eng(){
	win_name=window.open('image.php?pic=images/map_eng.jpg&name=Map','win_name','toolbar=no,scrollbars=no,width=530,height=370')
	win_name.focus()
}

function print_window(url){
	printwin=window.open(url,'printwin','toolbar=no,scrollbars=yes,width=800,height=480')
	printwin.focus()
}

function print_page(){
	window.print();
//	window.close();
}

function set_html(html){
	if(document.all){
		document.all['type'].firstChild.nodeValue=html+document.all['type'].firstChild.nodeValue;
	}
	else{
		document.elementbyid('type').innerHtml=html;
	}
}

function rewriteLayer (id, html) {
  if (document.layers) {
    var l = document[id];
    l.document.open();
    l.document.write(html);
    l.document.close();
  }
  else if (document.all) {
    document.all[id].innerHTML = html;
  }
  else if (document.createRange) {
    var l = document.getElementById(id);
    var r = document.createRange();
    while (l.hasChildNodes())
      l.removeChild(l.lastChild);
    r.setStartAfter(l);
    var docFrag = r.createContextualFragment(html);
    l.appendChild(docFrag);
  }
}

function preload_images() { //v3.0
	var d=document;
	if(d.images){
		if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=preload_images.arguments;
		for(i=0; i<a.length; i++){
			if (a[i].indexOf("#")!=0){
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
		}
	}
}

function imgnew() { //v3.0
	var i,j=0,x,a=imgnew.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3){
		if ((x=findObj(a[i]))!=null){
			document.MM_sr[j++]=x;
			if(!x.oSrc) x.oSrc=x.src;
			x.src=a[i+2];
		}
	}
}

function findObj(n, d) { //v4.0
	var p,i,x;
	if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n);
	return x;
}


//function imgnew(img_name,img_src) {
//	document[img_name].src=img_src;
//}

