
vars = new Object()
vars.which="nothing"
object2color = new String()
object2color=""
function chooseone(val,opt1,opt2)
{
var tempval=document.getElementById(val)
if(tempval.status)
return opt1;
else
return opt2;
}

function formswitch(which)
{
var tempval=document.getElementById('form_advanced')
tempval.style.display="none"
tempval="form_"+which
tempval=document.getElementById(tempval)
tempval.style.display="inline"
}

function display(what,which)
{
var tempval=document.getElementById(what)
tempval.style.display=which
}

function getAbsoluteX (elm) {
var x = 0;
if (elm && typeof elm.offsetParent != "undefined") {
while (elm && typeof elm.offsetLeft == "number") {
x += elm.offsetLeft;
elm = elm.offsetParent;
}
}
return x;
}

function getAbsoluteY(elm) {
var y = 0;
if (elm && typeof elm.offsetParent != "undefined") {
while (elm && typeof elm.offsetTop == "number") {
y += elm.offsetTop;
elm = elm.offsetParent;
}
}
return y;
}

function showcolors(where,id,obj2col)
{
object2color=obj2col
var tableElm = document.getElementById(where);
var x = getAbsoluteX(tableElm);
var y = getAbsoluteY(tableElm);

var menuElm = document.getElementById("colorchart");
menuElm.style.left = x +3+ "px";
menuElm.style.top = y +3+ "px";
vars.which=id

var tempval=document.getElementById("colorchart")
tempval.style.display="inline"

}

function showcolors2(x,y,id)
{
var tempval=document.getElementById("colorchart")
tempval.style.top=y+document.body.scrollTop
tempval.style.left=x+document.body.scrollLeft
tempval.style.display="inline"
vars.which=id
}

function colorchoose(color)
{
var ss=document.styleSheets[0]
var ssrule=ss.cssRules? ss.cssRules[3]: ss.rules[3]
//Access the first rule of the first stylesheet
//one of the above works in IE, the other in Mozilla family

document.getElementById(vars.which).value=color
document.getElementById(vars.which).style.background=color
//show colour in textbox defined by 'id' in showcolors()

if (object2color=="body"){
	//body text, rule 0
	ssrule=ss.cssRules? ss.cssRules[0]: ss.rules[0]
	ssrule.style.color=color
	//tooltip text
	dvBdycolor=color
}
if (object2color=="h3"){
	//h3 text, rule 3
	ssrule=ss.cssRules? ss.cssRules[3]: ss.rules[3]
	ssrule.style.color=color
	//and colorhighlight text, rule 6
	neontextcolor=color
	//link visited text, rule 9
	ssrule=ss.cssRules? ss.cssRules[9]: ss.rules[9]
	ssrule.style.color=color
	//link hover bg, rule 10
	ssrule=ss.cssRules? ss.cssRules[10]: ss.rules[10]
	ssrule.style.background=color
	//tooltip border
	dvborder='2px solid '+color
	//tooltip hdr bg
	dvHdrbackground=color

}

if (object2color=="colorhighlight"){
	//body text, rule 0
	ssrule=ss.cssRules? ss.cssRules[6]: ss.rules[6]
	ssrule.style.color=color
	neonbasecolor=color
	//link text, rule 8
	ssrule=ss.cssRules? ss.cssRules[8]: ss.rules[8]
	ssrule.style.color=color
	//link hover text, rule 10
	ssrule=ss.cssRules? ss.cssRules[10]: ss.rules[10]
	ssrule.style.color=color
}


if (object2color=="background"){
	//body text, rule 0
	ssrule=ss.cssRules? ss.cssRules[0]: ss.rules[0]
	ssrule.style.background=color
}
if (object2color=="boxx"){
	//boxx, rule 7
	ssrule=ss.cssRules? ss.cssRules[7]: ss.rules[7]
	ssrule.style.background=color
	//tooltip header text
	dvHdrcolor=color
	//tooltip bg
	dvBdybackground=color

}

}
function getvalue(what)
{
	var tempval=document.getElementById(what)
	return tempval.value;
}

function hide(what)
{
	var tempval=document.getElementById(what)
	tempval.style.display="none"
}

function changetrans(what, value)
{
	var tempval=document.getElementById(what)
	tempval.style.filter="alpha(opacity="+value+")";
	tempval.style.opacity=(value/100);
	
}
