 function gatherExtra(theForm)
 {
 	var totPrice = 0;
	var totString = '';

	var x = theForm.getElementsByTagName('INPUT');
	for (var i=0;i<x.length;i++) 
	{
		if(x[i].id.indexOf('item_')!=-1)
		{
			if(x[i].checked == true)
			{
				totPrice = parseFloat(totPrice) + parseFloat(x[i].value);
				totString = totString+' + '+x[i].title;
			}
		}
	}
	theForm.extraex.value = totPrice;
	theForm.custom3.value = totString;
	return true;
 }
 
 
function cmsOpenWindow(eURL,wi,hi){
	window.open(eURL,'window','toolbar=0,location=0,top=0,left=0,directories=0,scrollbars=1,status=0,menubar=0,resizable=1,width='+wi+',height='+hi+',dependant=yes');
	window.focus;
} 

var showWin = null;
function showPic(pic,wi,hi) {
	if(showWin != null) {
		if(!showWin.closed) {
			showWin.close();
		}
		showWin = window.open("",'window','toolbar=0,location=0,top=0,left=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,width='+wi+',height='+hi+',dependant=yes');
		showWin.document.open();
		showWin.document.clear();
		showWin.document.close();
		showWin.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
		showWin.document.write('<html>');
		showWin.document.write('<head>');
		showWin.document.write('	<title>'+pic+'</title>');
		showWin.document.write('	<META name="publisher" content="http://www.dqd.nl">');
		showWin.document.write('	<META name="charset" content="ISO-8859-1">');
		showWin.document.write('	<META name="copyright" content="© 2003 Digital Quality Design">');
		showWin.document.write('</head>');
		showWin.document.write('<script>');
		showWin.document.write('var arrTemp	= self.location.href.split("?");');
		showWin.document.write('var picUrl 	= (arrTemp.length>0)?arrTemp[1]:"";');
		showWin.document.write('var NS 		= (navigator.appName=="Netscape")?true:false;');
		showWin.document.write('function FitPic() {');
		showWin.document.write('	iWidth 	= (NS)?window.innerWidth:document.body.clientWidth;');
		showWin.document.write('	iHeight = (NS)?window.innerHeight:document.body.clientHeight;');
		showWin.document.write('	iWidth 	= document.images[0].width - iWidth;');
		showWin.document.write('	iHeight = document.images[0].height - iHeight;');
		showWin.document.write('	window.resizeBy(iWidth, (iHeight+20));');
		showWin.document.write('	self.focus();');
		showWin.document.write(' 	};');
		showWin.document.write('</script>');
		showWin.document.write('<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" onClick="window.close()" onBlur="window.close()" onLoad="javascript:FitPic();">');
		showWin.document.write('<img src='+pic+' border="0">');
		showWin.document.write('<script>javascript:FitPic();</script>');
		showWin.document.write('</body>');
		showWin.document.write('</html>');
		showWin.focus();
	}
	if (showWin == null) {
		showWin = window.open("",'window','toolbar=0,location=0,top=0,left=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,width='+wi+',height='+hi+',dependant=yes');
		showWin.document.open();
		showWin.document.clear();
		showWin.document.close();
		showWin.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
		showWin.document.write('<html>');
		showWin.document.write('<head>');
		showWin.document.write('	<title>'+pic+'</title>');
		showWin.document.write('	<META name="publisher" content="http://www.dqd.nl">');
		showWin.document.write('	<META name="charset" content="ISO-8859-1">');
		showWin.document.write('	<META name="copyright" content="© 2003 Digital Quality Design">');
		showWin.document.write('</head>');
		showWin.document.write('<script>');
		showWin.document.write('var arrTemp	= self.location.href.split("?");');
		showWin.document.write('var picUrl 	= (arrTemp.length>0)?arrTemp[1]:"";');
		showWin.document.write('var NS 		= (navigator.appName=="Netscape")?true:false;');
		showWin.document.write('function FitPic() {');
		showWin.document.write('	iWidth 	= (NS)?window.innerWidth:document.body.clientWidth;');
		showWin.document.write('	iHeight = (NS)?window.innerHeight:document.body.clientHeight;');
		showWin.document.write('	iWidth 	= document.images[0].width - iWidth;');
		showWin.document.write('	iHeight = document.images[0].height - iHeight;');
		showWin.document.write('	window.resizeBy(iWidth, (iHeight+20));');
		showWin.document.write('	self.focus();');
		showWin.document.write(' 	};');
		showWin.document.write('</script>');
		showWin.document.write('<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" onClick="window.close()" onBlur="window.close()" onLoad="javascript:FitPic();">');
		showWin.document.write('<img src='+pic+' border="0">');
		showWin.document.write('<script>javascript:FitPic();</script>');
		showWin.document.write('</body>');
		showWin.document.write('</html>');
		showWin.focus();
	}
}


function show(eID){
	document.getElementById(eID).style.display='block';
}
function hide(eID){
	document.getElementById(eID).style.display='none';
}

function switchShow(item, id)
{
	if(item.checked == true) 	show(id);
	else						hide(id);
}
var xmlhttp;
var temp1;
function loadSiteworksNode(url)
{
	xmlhttp=null;
	if (window.XMLHttpRequest)
	{// code for Firefox, Opera, IE7, etc.
		xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)  {// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null) {
		xmlhttp.onreadystatechange=state_Change;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
	else 
	{
		alert("Your browser does not support XMLHTTP.");
	}
}

function state_Change()
{
	if (xmlhttp.readyState==4) 
	{// 4 = "loaded"
		if (xmlhttp.status==200)
		{// 200 = "OK"
	    	document.getElementById('T1').innerHTML=xmlhttp.responseText;
			document.getElementById('T1').style.display='block';
			var theHandle = document.getElementById("handle");
			var theRoot = document.getElementById("T1");
			Drag.init(theHandle, theRoot);
		}
		else
		{
			alert("Problem retrieving data:" + xmlhttp.statusText);
		}
	}
}

/**************************************************
 * dom-drag.js
 * 09.25.2001
 * www.youngpup.net
 * Script featured on Dynamic Drive (http://www.dynamicdrive.com) 12.08.2005
 **************************************************
 * 10.28.2001 - fixed minor bug where events
 * sometimes fired off the handle, not the root.
 **************************************************/

var Drag = {

	obj : null,

	init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper) {
		o.onmousedown	= Drag.start;
		

		o.hmode			= bSwapHorzRef ? false : true ;
		o.vmode			= bSwapVertRef ? false : true ;

		o.root = oRoot && oRoot != null ? oRoot : o ;
		hPos = (screen.width/2) - 200;
		vPos = (screen.height/2) - 300;
/*	
		var hPos = 0;
		var vPos = 0;
		if (!e) var e = window.event;
		if (e.pageX || e.pageY) 	{
			hPos = e.pageX;
			vPos = e.pageY;
		}
		else if (e.clientX || e.clientY) 	{
			hPos = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
			vPos = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
		}
	// posx and posy contain the mouse position relative to the document
	// Do something with this information
		if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left   = hPos+"px";
		if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top    = vPos+"px";
		if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px";
		if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";
		*/	
		
		//if (isNaN(parseInt(o.root.style.left  ))) 
		thePosX = tempX+10;
		thePosY = tempY-o.root.style.height-40;
		if (thePosX < 0) thePosX = 0;
		if (thePosY < 0) thePosY = 0;
	
		o.root.style.left   = thePosX ;
		// if (isNaN(parseInt(o.root.style.top   ))) 
		o.root.style.top    = thePosY;
		if (isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px";
		if (isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";


		o.minX	= typeof minX != 'undefined' ? minX : null;
		o.minY	= typeof minY != 'undefined' ? minY : null;
		o.maxX	= typeof maxX != 'undefined' ? maxX : null;
		o.maxY	= typeof maxY != 'undefined' ? maxY : null;

		o.xMapper = fXMapper ? fXMapper : null;
		o.yMapper = fYMapper ? fYMapper : null;

		o.root.onDragStart	= new Function();
		o.root.onDragEnd	= new Function();
		o.root.onDrag		= new Function();
	},

	start : function(e)
	{
		var o = Drag.obj = this;
		e = Drag.fixE(e);
		var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
		var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		o.root.onDragStart(x, y);

		o.lastMouseX	= e.clientX;
		o.lastMouseY	= e.clientY;

		if (o.hmode) {
			if (o.minX != null)	o.minMouseX	= e.clientX - x + o.minX;
			if (o.maxX != null)	o.maxMouseX	= o.minMouseX + o.maxX - o.minX;
		} else {
			if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
			if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
		}

		if (o.vmode) {
			if (o.minY != null)	o.minMouseY	= e.clientY - y + o.minY;
			if (o.maxY != null)	o.maxMouseY	= o.minMouseY + o.maxY - o.minY;
		} else {
			if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
			if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
		}

		document.onmousemove	= Drag.drag;
		document.onmouseup		= Drag.end;

		return false;
	},

	drag : function(e)
	{
		e = Drag.fixE(e);
		var o = Drag.obj;

		var ey	= e.clientY;
		var ex	= e.clientX;
		var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
		var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		var nx, ny;

		if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
		if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
		if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
		if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);

		nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
		ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));

		if (o.xMapper)		nx = o.xMapper(y)
		else if (o.yMapper)	ny = o.yMapper(x)

		Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
		Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
		Drag.obj.lastMouseX	= ex;
		Drag.obj.lastMouseY	= ey;

		Drag.obj.root.onDrag(nx, ny);
		return false;
	},

	end : function()
	{
		document.onmousemove = null;
		document.onmouseup   = null;
		Drag.obj.root.onDragEnd(	parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), 
									parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
		Drag.obj = null;
	},

	fixE : function(e)
	{
		if (typeof e == 'undefined') 		e = window.event;
		if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
		if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
		return e;
	}
};