site_file.prototype.createBorder = function(obj,oWidth,oHeight,oTop,oLeft,oBorderWidth,oBorderType,oBorderColor)
{
  newFrame = elm.element("div",obj,"style='position: absolute; width: "+parseInt(oWidth)+"px; height:"+parseInt(oHeight)+"px; top: "+parseInt(oTop)+"px; left: "+parseInt(oLeft)+"px; border: "+parseInt(oBorderWidth)+"px "+oBorderType+" "+oBorderColor+";'");
  return newFrame;
}

site_file.prototype.createBottom = function(obj,oTop,oLeft,bottomWidth,number)
{
  this.frm[0] = this.createBorder(obj,bottomWidth*.9,bottomWidth/3,oTop,oLeft,1,"solid",settings.outerBorderColorArray[number][0]);
  for (n=1; n<settings.outerBorderColorArray[number].length; n++){
  	this.frm[n] = this.createBorder(this.frm[n-1],bottomWidth*.9-n*2,parseInt(bottomWidth/3-n*2),0,0,1,"solid",settings.outerBorderColorArray[number][n]);
	}
	this.frm[0].style.fontSize = 0;
	this.frm[0].style.backgroundColor = settings.mainBorderColorArray[number];
	return this.frm[0];
}

site_file.prototype.changeColor = function(colorNr)
{
  cooki.setCookie("boardColorNr",colorNr,360);
  window.location.href = "index.php";
}
site_file.prototype.changeBoardSize = function(sizeNr)
{
  cooki.setCookie("boardSizeNr",sizeNr,360);
  window.location.href = "index.php";
}

site_file.prototype.menuBoxCont4 = function(obj)
{
  elm.textNode("Vælg fave:",obj);
  this.colorBox = elm.element("div",obj,"style='position: relative; cursor: pointer;'");
  this.box1 = this.createBottom(this.colorBox,5,0,45,0);
	elm.addEvent(this.box1,"mousedown",site.changeColor,0)
  this.box2 = this.createBottom(this.colorBox,5,50,45,1);
	elm.addEvent(this.box2,"mousedown",site.changeColor,1)
  this.box3 = this.createBottom(this.colorBox,5,100,45,2);
	elm.addEvent(this.box3,"mousedown",site.changeColor,2)
  this.box4 = this.createBottom(this.colorBox,5,150,45,3);
	elm.addEvent(this.box4,"mousedown",site.changeColor,3)
  this.box5 = this.createBottom(this.colorBox,5,200,45,4);
	elm.addEvent(this.box5,"mousedown",site.changeColor,4)
  this.box6 = this.createBottom(this.colorBox,5,250,45,5);
	elm.addEvent(this.box6,"mousedown",site.changeColor,5)
  this.box7 = this.createBottom(this.colorBox,5,300,45,6);
	elm.addEvent(this.box7,"mousedown",site.changeColor,6)
  this.box8 = this.createBottom(this.colorBox,5,350,45,7);
	elm.addEvent(this.box8,"mousedown",site.changeColor,7)
  this.box9 = this.createBottom(this.colorBox,5,400,45,8);
	elm.addEvent(this.box9,"mousedown",site.changeColor,8)
  elm.textNode("<br /><br /><p>Vælg størrelse på bræt:</p>",obj);
  this.sizeBoxCont = elm.element("div",obj,"style='position: relative; '");
	this.sizeBox1 = elm.element("div",this.sizeBoxCont,"style='position: absolute; top: 7px; left: 10px; width: 10px; height: 10px; font-size: 0px; border: 1px solid #000; cursor: pointer;'");  
	elm.addEvent(this.sizeBox1,"mouseup",site.changeBoardSize,24)
  if (sizeNr==24)  this.sizeBox1.style.backgroundColor = "black";
	this.sizeBox2 = elm.element("div",this.sizeBoxCont,"style='position: absolute; top: 6px; left: 30px; width: 12px; height: 12px; font-size: 0px; border: 1px solid #000; cursor: pointer;'");  
	elm.addEvent(this.sizeBox2,"mouseup",site.changeBoardSize,22)
  if (sizeNr==22)  this.sizeBox2.style.backgroundColor = "black";
	this.sizeBox3 = elm.element("div",this.sizeBoxCont,"style='position: absolute; top: 5px; left: 52px; width: 14px; height: 14px; font-size: 0px; border: 1px solid #000; cursor: pointer;'");  
	elm.addEvent(this.sizeBox3,"mouseup",site.changeBoardSize,20)
  if (sizeNr==20)  this.sizeBox3.style.backgroundColor = "black";
	this.sizeBox4 = elm.element("div",this.sizeBoxCont,"style='position: absolute; top: 4px; left: 76px; width: 16px; height: 16px; font-size: 0px; border: 1px solid #000; cursor: pointer;'");  
	elm.addEvent(this.sizeBox4,"mouseup",site.changeBoardSize,18)
  if (sizeNr==18)  this.sizeBox4.style.backgroundColor = "black";
	this.sizeBox5 = elm.element("div",this.sizeBoxCont,"style='position: absolute; top: 3px; left: 102px; width: 18px; height: 18px; font-size: 0px; border: 1px solid #000; cursor: pointer;'");  
	elm.addEvent(this.sizeBox5,"mouseup",site.changeBoardSize,16)
  if (sizeNr==16)  this.sizeBox5.style.backgroundColor = "black";
	this.sizeBox6 = elm.element("div",this.sizeBoxCont,"style='position: absolute; top: 2px; left: 130px; width: 20px; height: 20px; font-size: 0px; border: 1px solid #000; cursor: pointer;'");  
	elm.addEvent(this.sizeBox6,"mouseup",site.changeBoardSize,14)
  if (sizeNr==14)  this.sizeBox6.style.backgroundColor = "black";

//  this.sizeBox = elm.element("div",this.sizeBoxCont,"style='position: absolute; top: 5px; left: 10px; width: 200px; height: 10px; font-size: 0px; border: 1px solid #000; '");
//  this.sizeBoxCurser = elm.element("div",this.sizeBoxCont,"className='dragme'","style='position: absolute; top: 0px; left: 102px; width: 5px; height: 20px; font-size: 0px; border: 1px solid #000; background-color: Blue; cursor: pointer;'");
//	this.sizeBoxCurser.onmousedown = selectmouse;
//	elm.addEvent(this.sizeBoxCont,"mouseup",site.changeBoardSize)
}

