var windowHandle = null;

function Maximize1() 
{
window.innerWidth = screen.width;
window.innerHeight = screen.height;
window.screenX = 0;
window.screenY = 0;
alwaysLowered = false;
}
function openmusic(play) {
if (play==1) {
	windowHandle=window.open('/music.htm','_blank','height=10;width=40;left=400;top=10;status=no,toolbar=no,menubar=no,location=no');
	}
	
}

/***********************************************
* Auto Maximize Window Script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for this script and 100's more.
***********************************************/
function Maximize(play) {
if (play==1) {
	top.window.moveTo(0,0);
	if (document.all) {
		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}
	else if (document.layers||document.getElementById) {
	if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
	top.window.outerHeight = screen.availHeight;
	top.window.outerWidth = screen.availWidth;
	}
	}
	}
}

function toggle(e) {
  if (e.style.display == "none") {
     e.style.display = "";
  } else {
     e.style.display = "none";
  }
}

function MenuSelect(a) {
  a.bgColor="#EDEDED";
}

function MenuUnSelect(a) {
  a.bgColor="#0000CC";
}

function toFloat(s) {
	re=/,/i;
	return(parseFloat(s.replace(re, ".")));
}

function toOutput(s) {
	re=".";
	return(s.replace(re, ","));
}

function WriteCombobox(reload,srcel,operation,x) {
var el;
//	alert(document.all.EditorsDiv.innerHTML );
	savedURL=document.location;
	var rec=new ActiveXObject("Microsoft.XMLHTTP");
	urlstr="/editor/a.asp?Operation="+operation+"&Idx="+x;
//	alert(urlstr);
	rec.open ("GET", urlstr, false);
	rec.Send();
	var response = rec.ResponseBody;
	var responseLength = rec.ResponseText.length;
	var oRS = new ActiveXObject("ADODB.Recordset");
	oRS.Fields.Append("Data", 200, responseLength, 0x80);
	oRS.Open();
	oRS.AddNew();
	oRS.Fields(0).AppendChunk(response);
	response = oRS(0).Value;
	oRS.Close();
//	alert(response);
//	document.all.supplier.innerHTML = response;
	srcel.innerHTML = response;
//	showel.style.display = "";
	if (reload=="1") {
	window.location.reload(true);}
//	html=rec.responseText;
//	alert(rec.responseText);
//	alert(rec.responseXML);
//	frm.AutomobileId.outerHTML=html;
//	alert(frm.AutomobileId.outerHTML);
}

function go(url) {
 window.location=url+"&WoodId="+document.getElementById("WoodId").value;	
}

function clickRadio(el) {
	sum=0.00;
	rc=parseInt(document.getElementById("recordcount").innerHTML);
	for (i=0; i<rc; i++) {
		if (document.getElementById("RI"+i).checked==true) {
		sum=sum+toFloat(document.getElementById("Cost"+i).innerHTML);
		}
	}
	sum=Math.round(sum*100)/100;
	tsum=toFloat(document.getElementById("Square").value)*sum
	tsum=Math.round(tsum*100)/100;
	ss=sum.toString(10);
	tss=tsum.toString(10);
	document.getElementById("SSum").innerHTML=toOutput(ss);
	document.getElementById("TSum").innerHTML=toOutput(tss);
}


function AddToBasket(url, qtyid) {
	qty=toFloat(document.getElementById(qtyid).value)
	url=url + "&Qty="+qty+"&IsService=False";
	location.href=url;
}


function AddToBasketService(url) {
	var rec=new ActiveXObject("Microsoft.XMLHTTP");
	rc=parseInt(document.getElementById("recordcount").innerHTML);
	qty=toFloat(document.getElementById("Square").value);
	for (i=0; i<rc; i++) {
		if (i==rc-1) {mode='I';} else {mode='IM';};
		if (document.getElementById("RI"+i).checked==true) {
			P=document.getElementById("PId"+i).name;
			urlstr=url + "&Mode=" + mode + "&Qty=" + qty + "&P=" + P+"&IsService=True";
		//	alert (urlstr);
			//urlstr="/editor/process.asp?URL=AddToBasket&Mode=U&OrderContId="+id+"&Qty="+parseFloat(val);
			rec.open ("POST", urlstr, false);
			rec.Send();

		}
	};
	location.href=url;
}

function do_change_qty(id, val) {
	var rec=new ActiveXObject("Microsoft.XMLHTTP");
	urlstr="/editor/process.asp?URL=AddToBasket&Mode=U&OrderContId="+id+"&Qty="+parseFloat(val);
	rec.open ("POST", urlstr, false);
	rec.Send();
	html=rec.responseText;
	document.all.TotalQty.innerHTML=html;
	document.all.TotalQty1.innerHTML=html;
//	document.all.TotalQty1.innerHTML=html;
}

var speed=1
var step=2
var whichimage=1

function slideit(){

//
if (!document.images)
return
//if (number_of_images==0) {initimages()};
if (document.all)
tracks.filters.revealtrans.apply()
//slide.filters.revealtrans.apply()
//slide.filters.blendTrans.apply()
document.images.slide.src=eval("image"+step+".src")
if (document.all)
tracks.filters.revealtrans.play()
//slide.filters.blendTrans.play()
//slide.filters.revealtrans.play()

whichimage=step

//hotref.href= eval("hrf"+step)


if (step<number_of_images)
step++
else
step=1
if (document.all)
setTimeout("slideit()",(speed+1)*4000)
else
setTimeout("slideit()",speed*4000)

}

