﻿//change the opacity for different browsers

function changeOpac(opacity) {
    var object = document.getElementById("vanisher").style;
    object.opacity = opacity / 100;
    object.MozOpacity = opacity / 100;
    object.KhtmlOpacity = opacity / 100;
    object.filter = "alpha(opacity=" + opacity + ")";
}

function FP_changeProp() {
    var args = arguments, d = document, i, j, id = args[0], o = FP_getObjectByID(id), s, ao, v, x;
    d.$cpe = new Array;
    if (o) {
        for (i = 2; i < args.length; i += 2) {
            v = args[i + 1];
            s = "o";
            ao = args[i].split(".");
            for (j = 0; j < ao.length; j++) {
                s += "." + ao[j];
                if (null == eval(s)) {
                    s = null;
                    break;
                }
            }
            x = new Object;
            x.o = o;
            x.n = new Array;
            x.v = new Array;
            x.n[x.n.length] = s;
            eval("x.v[x.v.length]=" + s);
            d.$cpe[d.$cpe.length] = x;
            if (s) {
                eval(s + "=v");
            }
        }
    }
}


function FP_getObjectByID(id, o) {
    var c, el, els, f, m, n;
    if (!o) {
        o = document;
    }
    if (o.getElementById) {
        el = o.getElementById(id);
    } else if (o.layers) {
        c = o.layers;
    } else if (o.all) {
        el = o.all[id];
    }
    if (el) {
        return el;
    }
    if (o.id == id || o.name == id) {
        return o;
    }
    if (o.childNodes) {
        c = o.childNodes;
    }
    if (c) {
        for (n = 0; n < c.length; n++) {
            el = FP_getObjectByID(id, c[n]);
            if (el) {
                return el;
            }
        }
    }
    f = o.forms;
    if (f) {
        for (n = 0; n < f.length; n++) {
            els = f[n].elements;
            for (m = 0; m < els.length; m++) {
                el = FP_getObjectByID(id, els[n]);
                if (el) {
                    return el;
                }
            }
        }
    }
    return null;
}

//JScript Popoup Window (eg. Privacy)
var win = null;
	function NewWindow(mypage,myname,w,h,scroll,pos)
	{
	if(pos=="random")
	    {
	    LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	    }
	if(pos=="center")
	    {
	    LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	    }
	else if((pos!="center" && pos!="random") || pos==null)
	    {
	    LeftPosition=0;TopPosition=20
	    }
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);}
