
var DHTML=0, DOM=0, MS=0, NS=0, OP=0;

function DHTML_init(){
	if(window.opera){OP=1;}
	if(document.getElementById){DHTML=1;DOM=1;}
	if(document.all && !OP){DHTML=1;MS=1;}
	if(window.netscape && window.screen && !DOM && !OP){DHTML=1;NS=1;}
}

function oID(ID){
	if(DOM){if(typeof document.getElementById(ID)=='object')return(document.getElementById(ID)); else return(void(0));
	}else if(MS){if(typeof document.all[ID]=='object')return(document.all[ID]);else return(void(0));
	}else if(NS){if(typeof document[ID]=='object')return(document[ID]);else return(void(0));}
}
function oName(p2){
	if(DOM){if(typeof document.getElementsByName(p2)=="object")return(document.getElementsByName(p2)[0]);	else return(void(0));
	}else if(MS){if(typeof document[p2]=="object")return(document[p2]);	else return(void(0));
	}else if(NS){if(typeof document[p2]=="object")return(document[p2]);	else return(void(0));}
}
DHTML_init();




function pID(param,defID,x) {
	return (oID((param || defID)) || (x || false));	
}

function hide(ID){
	oID(ID).style.visibility="hidden";
}
function show(ID){
	oID(ID).style.visibility="visible";
}
function hidedisp(ID){
	oID(ID).style.visibility="hidden";
	oID(ID).style.display="none";
}
function showdisp(ID){
	oID(ID).style.visibility="visible";
	oID(ID).style.display="inline";
}

function comboSelectValue(c, val) {
	var ops = c.getElementsByTagName('option');
	for (var i = ops.length; --i >= 0;) {
		var op = ops[i];
		op.selected = (op.value == val);
	}
	c.value = val;
};


function getAbsolutePos(el) {
	var r = { x: el.offsetLeft, y: el.offsetTop };
	if (el.offsetParent) {
		var tmp = getAbsolutePos(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
	}
	return r;
};

function oIFRM(_name,sessID){
	this.name=_name;
	this.init=_oIFRM_init;
	this.outit=_oIFRM_outit;
	this.check_parent=_oIFRM_check_parent;
	this.SID=sessID;
}

function _oIFRM_init(){
	this.check_parent();
	if(parent.oWIN){
		if(parent.oWIN.oIFRM_Loaded)parent.oWIN.oIFRM_Loaded(this.name);
	}else{
		top.oWIN.oIFRM_Loaded(this.name);
	}
}
function _oIFRM_outit(){
	if(parent.oWIN){
		if(parent.oWIN.oIFRM_Unloading){
			if(parent.oWIN.oIFRM_Unloading)parent.oWIN.oIFRM_Unloading(this.name);
		}
	}
	else{
		if(top){
			if(top.oWIN){
				if(top.oWIN.oIFRM_Unloading){
					top.oWIN.oIFRM_Unloading(this.name);
				}
			}
		}
	}
}

function _oIFRM_resize(){
	
}


function _oIFRM_check_parent(){
	if(top){mytarget=top;}
	else{mytarget=parent;}
	if((!mytarget.oWIN)||(mytarget.oWIN.SID!=this.SID)){
//		alert(oWIN.SID+" a "+this.SID);
//		mytarget.location.href="index.php";
//		top.location.href="index.php";
	}
}



function my_refresh_all(caColors,MenuWidth,TableWidth){
	top.oWIN.ReColor(caColors);
	top.oWIN.RePos(MenuWidth,TableWidth);
}




