function lsl()
{
 var i;
 while(document.forms['edit'].elements['page'].options.length > 0)
 {
  document.forms['edit'].elements['page'].options[document.forms['edit'].elements['page'].options.length - 1] = null;
 }
 var sel = window.frames['lsel'].document.forms['edit'].elements['page'];
 var tsel = document.forms['edit'].elements['page'];
 for (i = 0; i < sel.options.length; i++)
 {
  var opt = new Option(sel.options[i].innerHTML, sel.options[i].value);
  tsel.options[i] = opt;
  if (document.forms['edit'].elements['op'].value == sel.options[i].value)
   tsel.options[i].selected = 1;
 }
}

function loadpage(urla,fram){
 window.frames[fram].document.location = urla;
}

function order(id)
{
 document.location.href = 'index.php?chp=order&id='+id;
}

function cm_bwcheck(){
	//In theory we should use object detection, but this script needs work-arounds for almost every browser...
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent.toLowerCase()
	this.dom=document.getElementById?1:0
	this.ns4=(!this.dom && document.layers)?1:0;
	this.op=window.opera 
	this.moz=(this.agent.indexOf("gecko")>-1 || window.sidebar)
	this.ie=this.agent.indexOf("msie")>-1 && !this.op
	if(this.op){
		this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1)
		this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1)
		this.op7=this.dom&&!this.op5&&!this.op6 //So all higher opera versions will use it
	}else if(this.agent.indexOf("netscape6")>-1) this.ns6 = 1
	else if(this.ie){
		this.ie4 = !this.dom && document.all
  	this.ie5 = (this.agent.indexOf("msie 5")>-1)
  	this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1)
  	this.ie6 = this.dom && !this.ie4 && !this.ie5 && ! this.ie55
	} 
	if(this.moz){
	                    if(this.agent.indexOf("rv:1.0")>-1) {this.moz10=1}
                            if(!this.moz10) {this.moz14=1}
 	}
	this.mac=(this.agent.indexOf("mac")>-1)
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6 || this.op7)
  this.usedom= this.ns6||this.op7//Use dom creation
  this.reuse = this.ie||this.op7||this.usedom //Reuse layers
  this.px=this.dom&&!this.op5?"px":""
	return this
}
var bw=new cm_bwcheck()

function bcss()
{
var a=0;
 if (bw.ns4==1) {document.writeln('<link href=\"\/css\/nn47.css\" rel=\"stylesheet\" type=\"text/css\">'); a=1;}
 if (bw.ns6) {document.writeln('<link href=\"\/css\/nn6.css\" rel=\"stylesheet\" type=\"text/css\">'); a=1;}
 if (bw.op) {document.writeln('<link href=\"\/css\/opera7.css\" rel=\"stylesheet\" type=\"text/css\">'); a=1;}
 if (bw.moz10) {document.writeln('<link href=\"\/css\/moz10.css\" rel=\"stylesheet\" type=\"text/css\">'); a=1;}
 if (bw.moz14) {document.writeln('<link href=\"\/css\/moz14.css\" rel=\"stylesheet\" type=\"text/css\">'); a=1;}
 if (bw.ie5) {document.writeln('<link href=\"\/css\/ie50.css\" rel=\"stylesheet\" type=\"text/css\">'); a=1;}
 if (bw.ie5) {document.writeln('<link href=\"\/css\/ie55.css\" rel=\"stylesheet\" type=\"text/css\">'); a=1;}
 if (bw.ie6) {document.writeln('<link href=\"\/css\/ie60.css\" rel=\"stylesheet\" type=\"text/css\">'); a=1;}
 if (a==0) {document.writeln('<link href=\"\/css\/main.css\" rel=\"stylesheet\" type=\"text/css\">'); a=1; }
}

function smenu(id)
{
  document.images["i"+id].src="img/mg.gif"
}
function hmenu(id)
{
  document.images["i"+id].src="img/p.gif"
}

function vers()
{
 document.writeln('<h4> ver='+bw.ver+';<br>ns4='+bw.ns4+';<br>op='+bw.op+';<br>moz='+bw.moz+';<br>agent='+bw.agent+';<br>ns6='+bw.ns6+';</h4>');
 document.writeln('<h4> moz10='+bw.moz10+';<br>moz14='+bw.moz14+';</h4>');
// <br>op='+bw.op+';<br>moz='+bw.moz+';<br>agent='+bw.agent+';<br>ns6='+bw.ns6+';</h4>');
}
