jQuery(document).ready(function(){
jQuery("#colorshades").load("http://phpforms.net/colorpanel.php?colorhex=ff0000");
})
var colorhex="#FF0000"
function mouseOverColor(hex)
{
document.getElementById("divpreview").style.backgroundColor=hex;
document.getElementById("divpreviewtxt").innerHTML=hex;
document.body.style.cursor="pointer";
}

function mouseOutMap()
{
document.getElementById("divpreview").style.backgroundColor=colorhex;
document.getElementById("divpreviewtxt").innerHTML=colorhex;
document.body.style.cursor="";
}

function clickColor(hex,seltop,selleft)
{
var xhttp,c
if (hex==0)
	{
	c=document.getElementById("colorhex").value;
	}
else
	{
	c=hex;
	}
if (c.substr(0,1)=="#")
	{
	c=c.substr(1);
	}
colorhex="#" + c;
document.getElementById("colorhex").value=colorhex;
//if (window.XMLHttpRequest)
//  {
/*  xhttp=new XMLHttpRequest();
  }
else
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }*/
//xhttp.open("GET","colorpanel.php?colorhex=" + c + "&r=" + Math.random(),false);
//xhttp.send("");
//alert(xhttp.responseText);
//a = setTimeout('document.getElementById("colorshades").innerHTML=xhttp.responseText', 3000);
jQuery("#colorshades").load("http://phpforms.net/colorpanel.php?colorhex=" + c);
if (seltop>-1 && selleft>-1)
	{
	document.getElementById("selectedColor").style.top=seltop + "px";
	document.getElementById("selectedColor").style.left=selleft + "px";
	document.getElementById("selectedColor").style.visibility="visible";
	}
else
	{
	document.getElementById("divpreview").style.backgroundColor=colorhex;
	document.getElementById("divpreviewtxt").innerHTML=colorhex;
	document.getElementById("selectedColor").style.visibility="hidden";
	}
//refreshleader()
}