// BrowserCheck Object 
function BrowserCheck() { 
 
	var b = navigator.appName 
	if (b=="Netscape") this.b = "ns" 
	else if (b=="Microsoft Internet Explorer") this.b = "ie" 
	else this.b = b 
	this.version = navigator.appVersion 
	this.v = parseInt(this.version) 
	this.ns = (this.b=="ns" && this.v>=4) 
	this.ns4 = (this.b=="ns" && this.v==4) 
	this.ns5 = (this.b=="ns" && this.v==5) 
	this.ie = (this.b=="ie" && this.v>=4) 
	this.ie4 = (this.version.indexOf('MSIE 4')>0) 
	this.ie5 = (this.version.indexOf('MSIE 5')>0) || (this.version.indexOf('MSIE 6')>0); 
	this.min = (this.ns||this.ie) 
	this.dom = document.getElementById ? 1 : 0; 
 
} 
 
function orderRecord( side, nside ) { 
 
	sl = document.fm[side].selectedIndex; 
	if (sl != -1 ){ 
		if(document.fm[side].options[sl].value==".none") { 
			alert('Lista jest pusta'); 
			return false; 
		} 
		//it's about adding new option 
		oText = document.fm[side].options[sl].text; 
		oValue = document.fm[side].options[sl].value; 
		max = document.fm[nside].length; 
		if(max==1 && document.fm[nside].options[max-1].value==".none"){ 
			max = 0; 
		} 
		document.fm[nside].options[max] = new Option(oText,oValue,0,0) 
		document.fm[nside].options[max].selected = true; 
		max = document.fm[side].length; 
 
		//it's about changes in old select 
		if((sl-1)>=0){ 
			document.fm[side].options[sl-1].selected = true; 
			document.fm[side].options[sl] = null; 
			if(sl != (max-1)){ 
				document.fm[side].selectedIndex++; 
			} 
		} else { 
			if(max != 1){ 
				document.fm[side].options[sl+1].selected = true; 
				document.fm[side].options[sl] = null;   
			} else { 
				document.fm[side].options[0].text = "-- pusta lista --"; 
				document.fm[side].options[0].value = ".none"; 
			}   
		} 
	} else { 
		alert('Wybierz pozycję'); 
	} 
 
	return false; 
} 
 
function doSubmit(item,sel) { 
	document.fm[item].value = doSubSide(sel); 
	return true; 
} 
 
function doSubSide(side) { 
	val = ""; 
	for (i=0;i<document.fm[side].length;i++) { 
		if (i!=0) { val += ","; } 
		if(document.fm[side].options[i].value!=".none") val += document.fm[side].options[i].value; 
	} 
	return val; 
} 
 
function changeURL(url,side) { 
	id = side.options[side.selectedIndex].value; 
	document.location.href = url+id; 
}
