
function PreloadImages() {
    var d=document; 
    if (d.images) { 
	if (!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=PreloadImages.arguments; 
	for (i=0; i<a.length; i++) {
	    d.MM_p[j]=new Image; 
	    d.MM_p[j++].src='/pic/'+a[i]+'_on.gif';
	    d.MM_p[j]=new Image; 
	    d.MM_p[j++].src='/pic/'+a[i]+'_off.gif';
	}
    }
}

function menu(ImageName,onoff) {
        d = document.getElementById(ImageName);
        d.src = '/pic/'+ImageName+'_'+onoff+'.gif';
}

function htenclose(b,e,id) {

    var o=document.getElementById(id);
    o.focus();
    var t=document.selection.createRange().text;
    if (t.substr(0,b.length)==b && t.substr(t.length-e.length)==e) {
        document.selection.createRange().text = t.substr(b.length,t.length-e.length-b.length);
    } else {
        document.selection.createRange().text = b+t+e;
    }
    o.focus();
}

function htinsert(text,id) {
    var o=document.getElementById(id);
    o.focus();
    document.selection.createRange().text = text;
    o.focus();
}

var pic_popup;

function zoom_pic(id,w,h,type) {
    if (pic_popup) pic_popup.close();
    pic_popup=window.open('/zoom?id='+id+'&type='+type,'shpicz','width='+(30+w)+', height='+(80+h)+', scrollbars=yes, resizable=yes');
    pic_popup.focus();
}


