/**
*q143329_q8
  *Grab the form above, by its divs :)
  *hide all but the first and the coment
  *start doing freeky things when they change the form values
  *clear any hidden sections of the form
  */
function funny_form()
{
	var _frm = document.getElementById('form_email_143326');//the full form
	var _divs = new Array();//the sections
	_divs[0] = document.getElementById('accom');
	_divs[1] = document.getElementById('homestay');
	_divs[2] = document.getElementById('temp_stay');
	_divs[3] = document.getElementById('arrive_details');
	_divs[4] = document.getElementById('personal_info');
	var _accom = document.getElementById('q143328_q15_0');//accom button
	var _pickup = document.getElementById('q143328_q15_1');//pick up button
	var _home = document.getElementById('q143328_q16_0');//home stay radio
	var _away = document.getElementById('q143328_q16_1');//temp stay
	var _going = document.getElementById('q143329_q8');//the text that doesnt make me happy
	var _id = '';//the selected its id
	var _old = '';//the old selected item
	var _mark = false;//if we should complain
	//pop up vars
	var ie = (navigator.userAgent.indexOf("MSIE") >= 0) ? true : false;
	
	
/**
  *clear_section
  *pass it a container and it will try to clear the results
  *input
  *select
  *textarea
  */
	function clear_section(_sec)
	{
		//need to clear all inputs and selects and radio buttons from this section of the form
		var _in = _sec.getElementsByTagName('input');
		var _se = _sec.getElementsByTagName('select');
		var _te = _sec.getElementsByTagName('textarea');
		if(_in.length > 0 || _se.length > 0 || _te.length > 0)
		{
			var _all = new Array(_in,_se,_te);
			var _i = 0;
			var _l = _all.length;
			for(_i=0; _i<_l; _i++)
			{
				var _in = 0;
				var _inl = _all[_i].length;
				for(_in=0; _in<_inl; _in++)
				{
					switch(_i)
					{
						case 0:
						//it has to be an input
						//text hidden checkbox radio button submit
							switch(_all[_i][_in].type)
							{
								case 'text':
									_all[_i][_in].value = '';
									break;
								case 'radio':
								case 'checkbox':
									_all[_i][_in].checked = false;
									break;
							}
							break;
						case 1:
						//select list
							_all[_i][_in].selectedIndex = 0;
							break;
						case 2:
						//text area
							_all[_i][_in].value = '';
							break;
					}
					
				}
			}
		}
		
	}
	
	function toggle_pickup(e)
	{
		e = ( e ) ? e : event;
		var el = e.target || e.srcElement;
		if(_divs[3].style.display == 'block')
		{
			var _text = 'Your input will be lost, do you want to continue? <br />Click the button to continue';
			pop_up(el,finish_pickup,_text)
			return(false);
		}
		else
		{
			toggle(3);
			return(true);
		}
	}
	function finish_pickup()
	{
		clear_section(_divs[3]);
		_pickup.checked = _pickup.checked == true ? false : true;
		toggle(3);
	}
	function toggle_stay(e)
	{
		//hack
		e = ( e ) ? e : event;
		var el = e.target || e.srcElement;
		while(!el.getAttribute('id'))
		{
			el= el.parentNode;
		}
		_old = _id;
		_id = el.getAttribute('id');
		if(_divs[1].style.display == 'block' || _divs[2].style.display == 'block')
		{
			if(_id == 'q143328_q16_0')
			{
				_text = 'Your input will be lost from the temp stay section<br /> do you want to continue?';
			}
			else
			{
				_text = 'Your input will be lost from the home stay section<br /> do you want to continue?';
			}
			_mark = true;
			pop_up(el,finish_stay,_text);
			return(false);
		}
		else
		{
			_mark = false;
			finish_stay();
		}
		return(true);
	}
	function finish_stay()
	{
	
		if(_id == 'q143328_q16_0')
		{
			
			_divs[1].style.display = 'block';
			_divs[2].style.display = 'none';
			clear_section(_divs[2]);
			_going.value = 'I would like the University to arrange a Homestay placement for me.';
			if(_mark)
			{
				_home.checked = true;
				_away.checked = false;
				_mark=false;
			}
		}
		else
		{

			_divs[1].style.display = 'none';
			_divs[2].style.display = 'block';
			clear_section(_divs[1]);
			_going.value = 'I would like the University to arrange temporary accommodation for me.';
			if(_mark)
			{
				_home.checked = false;
				_away.checked = true;
				_mark = false;
			}
		}
	}
/**
  *toggle_accom
  *called on click of the accom check box
  *checks to see if it should complain
  *stalls by calling pop up if live
  */
	function toggle_accom(e)
	{
		e = ( e ) ? e : event;
		var el = e.target || e.srcElement;
		if(_divs[0].style.display == 'block')
		{
			var _text = 'Your input will be lost from the accomodation section<br /> do you want to continue?';
			pop_up(el,finish_accom,_text);
			return(false);
		}
		else
		{
			toggle(0);
			return(true);
		}
	}
/**
  *finish_accom
  *used by toggle accom via popup
  */
	function finish_accom()
	{
		
		clear_section(_divs[0]);
		clear_section(_divs[1]);
		clear_section(_divs[2]);
		_divs[1].style.display='none';
		_divs[2].style.display='none';
		_going.value = '';
		_accom.checked = _accom.checked == true ? false : true;
		toggle(0);
	}
/**
  *toggle
  *changes the display status of one of the sections 
  *id = the divs object to change
  */
	function toggle(id)
	{
		if(_divs[id].style.display == 'none')
		{
			_divs[id].style.display = 'block';
		}
		else
		{
			//alert('Shit');
			_divs[id].style.display = 'none';
		}
	}
/**
  *final check
  *replaces the submit for the main form so it can be validated
  */
	function final_check()
	{
		//alert('final check');
		var i=0;
		var l= _divs.length;
		var re = new RegExp('required');
		var count = 0;
		for(i=0; i<l; i++)
		{
			//alert(_divs[i].style.display);
			if(_divs[i].style.display != 'none')
			{
				//alert('checkin ' + _divs[i].getAttribute('id'));
				var _dt = _divs[i].getElementsByTagName('dt');
				var di = 0; 
				var dl = _dt.length;
				for(di=0; di<dl; di++)
				{
					if(_dt[di].innerHTML.match(re) && popper_div(_dt[di]))
					{
						var done = false;
						var nn = _next(_dt[di]);
						var nm = '';
						//from here
						var nchild = nn.getElementsByTagName('*');
						var ni=0;
						var nl=nchild.length;
						//alert(nl + ' ' + nn.innerHTML);
						for(ni=0; ni<nl; ni++)
						{
							//alert(nchild[ni].nodeName + ' ' + nchild[ni].getAttribute('id'));
							//var ddoo = true;//popper_div(nchild[ni]);
							//if(ddoo)
							//{
								switch(nchild[ni].nodeName)
								{
									case 'INPUT':
										switch(nchild[ni].getAttribute('type'))
										{
											case 'text':
											//alert('found required text area with value of ' + nchild[ni].value);
												done = nchild[ni].value != '' ? true : done;
												nm = nm == '' ? nchild[ni] : nm;
												break;
											case 'radio':
											case 'checkbox':
											//alert(nchild[ni].checked);
												done = nchild[ni].checked ? true : done;
												nm = nm == '' ? nchild[ni] : nm;
												break;
										}
										break;
									case 'SELECT':
									//alert('select ' + nchild[ni].selectedIndex);
										nm = nm == '' ? nchild[ni] : nm;
										done = nchild[ni].selectedIndex > 0 ? true : done;
										break;
									case 'TEXTAREA':
										done = nchild[ni].value != '' ? true : done;
										nm = nm == '' ? nchild[ni] : nm;
										break;
									default:
									 //alert(nchild[ni].nodeName);
									 	break;
								}
								if(done)
								{
									ni = nl;
								}
							//}
						}
						if(!done)
						{
							//alert(nm.getAttribute('id'));
							nm.focus();
							
							pop_up(nm,_next,_dt[di].innerHTML,true);
							return(false);
						}
					}
				}
			}
		}
		//alert('would submit now');
		return(true);
	}
	function _next(elm)
	{
		elm = elm.nextSibling;
		while(elm.nodeName == '#text')
		{
		    elm = elm.nextSibling;
		}
		return(elm)
	}
	function popper_div(elm)
	{
		//alert(elm.nodeName + ' ' + elm.getAttribute('id'));
		elm = elm.parentNode;
		while(elm.nodeName != 'DIV')
		{
		    elm = elm.parentNode;
		}
		//alert(elm.nodeName + ' ' + elm.getAttribute('id'));
		if(elm.style.display != 'none')
		{
			return(true);
		}
		else
		{
			return(false);
		}
	}
	
	function check_email(email)
	{
		
	}
	
//pop up code from here
	function pop_up(el,_func,_text,_dobon)
	{	
		/*main function creates the pop up*/
		var _dobon = !_dobon ? true : false;
		var _func = !_func ? finish_stay : _func;//function to call on reply
		var _text = !_text ? 'You will lose the information you have enterd into this section do you want to continue' : _text;
		/*all pop up moving vars from here dont set them they will be over written in the script anyway*/
		var ourX = 0;
		var ourY = 0;
		var _drag_int;//used to move and pos the pop up
		var tempX=0;
		var tempY=0;
		var offsetX=0;
		var offsetY=0;
		var screenW=0;//
		var screenH=0;//to here
		var screenT=0;
		var screenL=0;
		/*end pop up moving vars*/
	
		var cause='';
		var ie_hack='';
		var iecount=0;
		var thep='';
		var thet='';
		var _int_fake = '';
		var _steps = 20;
		function make_win(el)	
		{	
			//alert('make win called');
			if(document.getElementById('pop_up'))	
			{	
				document.getElementById('pop_up').parentNode.removeChild(document.getElementById('pop_up'));	
			}	
			//cause='';
		  	document.onmousemove = getMouseXY;
		  	window_size();
			//var __url = el.getAttribute('pop_up');		
			var _name = 'Warning';	
		 	var wide = screenL + (screenW / 2) - 100;
		 	var high = screenT + (screenH / 2) - 100;
			var _par = document.getElementsByTagName('body')[0];
			var _newdiv = make_thing('div','pop_up','','');//make a box
			_newdiv.style.position = 'absolute';

			//will need to do better here
			_newdiv.style.top = '-999px';//get over the banner
			_newdiv.style.left = '-999px'//put it to thr right
			_newdiv.style.width = '200px';
			_newdiv.style.height = '200px';
			//add a tiny div relative
			var _tiny = make_thing('div','has_shad');
			_tiny.style.position = 'relative';
			make_clear(_tiny,0.5);
			_newdiv.appendChild(_tiny);
			//add the drop shadow
			//h2 //set drag	
			var _h2 = make_thing('h1','pop_name','','',' ' + _name);
			_h2.onmousedown = set_drag;
			_h2.onmouseup = stop_drag;
			_newdiv.appendChild(_h2);
			_newdiv.onmouseout = stop_drag;
			//div x
			var _x = make_thing('div','thex');
			//add the closer
			var _a = make_thing('a','','','','X');
			_a.onclick = close_it;
			_a.onmouseover = function(){this.style.cursor = 'pointer';};
			_a.onmouseout = function(){this.style.cursor = 'default';};
			_x.appendChild(_a);
			_newdiv.appendChild(_x);
			//add a loader image
			var _con = make_thing('div','','','','<center>' + _text + '</center>');
			_newdiv.appendChild(_con);
			if(_dobon)
			{
				var _bon = make_thing('input','clicker','clicker','clicker','');
				_bon.value = 'Continue';
				//_bon.style.margin = '50px';
				_bon.type='button';
				_bon.onclick = comit_it;
				_newdiv.appendChild(_bon);
			}
			_par.appendChild(_newdiv);
			_newdiv = document.getElementById('pop_up');
			_newdiv.style.width='220px';
			_newdiv.style.height= '220px';
			var aspan = _newdiv.getElementsByTagName('h1')[0];
		
			aspan.style.width = !ie ? _newdiv.offsetWidth : _newdiv.offsetWidth - 10;
		
			//now we really have a div place it correctley on the page
		
			wide = screenL + (screenW / 2) - (_newdiv.offsetWidth / 2);
		
		 	high = screenT + (screenH / 2) - (_newdiv.offsetHeight / 1.9);//move it up a littl
		
		 	high = high < screenT + 20 ? screenT +  20 :high;
		
		 	wide = wide < 0 ? 0 : wide;			
			pop_ani(el,new Array(wide,high,_newdiv.offsetWidth,_newdiv.offsetHeight));
			if(!ie)
			{
				_has_shad('has_shad',_newdiv.offsetWidth - 1,_newdiv.offsetHeight - 1);
			}
			else
			{
				_has_shad('has_shad',_newdiv.offsetWidth - 2,_newdiv.offsetHeight - 2);
			}
			//return(false);
		}
	
		
	
		function pop_ani(el,targs)
		{

			//make a div at start point
			thep = findPos(el);
			thet = targs;
			
			var pop_fake=make_thing('div','pop_up_fake','','',' ');
			pop_fake.style.position = 'absolute';
			pop_fake.style.top = thep[0] + 'px';
			pop_fake.style.left = thep[1] +'px';
			//alert(thep[0] + ' ' + thep[1]);
			thep[2] = ((thep[0] - thet[0]) / _steps) * 2;
			thep[3] = ((thep[1] - thet[1]) / _steps) * 2;
			thep[4] = 0.1;
			thep[5] = 0.1;
			thep[6] = 0;
			thep[7] = pop_fake.offsetWidth;
			thep[8] = pop_fake.offsetHeight;
			thep[9] = ((thet[2] - thep[7]) / _steps) * 2;
			thep[10] = ((thet[3] - thep[8]) / _steps) * 2;
			make_clear(pop_fake,thep[2]);
			var bod = document.getElementsByTagName('body')[0];
			bod.appendChild(pop_fake);
			_int_fake=setInterval(fake_move,33);
			//animate to pop up point
			//remove and show pop up
		}
	
		function fake_move()
		{
			var pop_fake=document.getElementById('pop_up_fake');
			thep[0] -= thep[2];
			thep[1] -= thep[3];
			thep[4] += thep[5];
			thep[7] += thep[9];
			thep[8] += thep[10];
			pop_fake.style.top = thep[1] + 'px';
			pop_fake.style.left = thep[0] + 'px';
			pop_fake.style.width = thep[7] + 'px';
			pop_fake.style.height = thep[8] + 'px';
			make_clear(pop_fake,thep[4]);
			thep[6]++;
			if(thep[6] == 10)
			{
				clearInterval(_int_fake);
				//alert('done');
				var _newdiv = document.getElementById('pop_up');
				_newdiv.style.top = thep[1] + 'px';
				_newdiv.style.left = thep[0] + 'px';
				pop_fake.parentNode.removeChild(pop_fake);
			}
		}
	
		function comit_it()
		{
			close_it();
			_func();
		}
	
		function close_it()
		{
			fader();
		}
	
		function set_drag()
		{
			//alert('set drag called');
	
			//need the pos of the div could be anywhere
	
			var el = document.getElementById('pop_up');
			var _arr= findPos(el);
			offsetX = tempX - _arr[0];
			offsetY = tempY - _arr[1];
			_drag_int = setInterval(do_drag,3); 
		}
	
		function stop_drag()
		{
			//alert('stop drag called');
			clearInterval(_drag_int);
		}
	
		function do_drag()
		{
			var posX =  tempX - offsetX;// - offsetX;
			var posY = tempY - offsetY;
			var el = document.getElementById('pop_up');
			el.style.top = posY + 'px';
			el.style.left = posX + 'px';
			//el.setAttribute('style','position:absolute; top:' + posY + 'px; left:' +  posX + 'px');
		}
	
		//requires the ie var

		function window_size()
		{
			var myWidth = 0, myHeight = 0;
			  if( typeof( window.innerWidth ) == 'number' ) 
			  {
			    //Non-IE
			    myWidth = window.innerWidth;
			    myHeight = window.innerHeight;
			  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			    //IE 6+ in 'standards compliant mode'
			    myWidth = document.documentElement.clientWidth;
			    myHeight = document.documentElement.clientHeight;
			  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			    //IE 4 compatible
			    myWidth = document.body.clientWidth;
			    myHeight = document.body.clientHeight;
			  }
			screenW = myWidth;
			screenH = myHeight;
			var temp = getScrollXY();
			screenT = temp[1];
			screenL = temp[0];
		}
	
		function getScrollXY()
		{
		  var scrOfX = 0, scrOfY = 0;
		  if( typeof( window.pageYOffset ) == 'number' ) {
		    //Netscape compliant
		    scrOfY = window.pageYOffset;
		    scrOfX = window.pageXOffset;
		  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		    //DOM compliant
		    scrOfY = document.body.scrollTop;
		    scrOfX = document.body.scrollLeft;
		  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		    //IE6 standards compliant mode
		    scrOfY = document.documentElement.scrollTop;
		    scrOfX = document.documentElement.scrollLeft;
		  }
		  return [ scrOfX, scrOfY ];
		}
	
			
	
		function getMouseXY(e) 
		{	
		  if (ie) 
		  { // grab the x-y pos.s if browser is IE
		 	var sSide=document.documentElement?document.documentElement.scrollLeft:document.body.scrollLeft;
			var sTop=document.documentElement?document.documentElement.scrollTop:document.body.scrollTop;
		    tempX = event.clientX+ sSide;
		    tempY = event.clientY + sTop;
		  } 
		  else 
		  {  // grab the x-y pos.s if browser is NS
		    tempX = e.pageX;
		    tempY = e.pageY;
		  }  
		  // catch possible negative values in NS4
		  if (tempX < 0)
		  {
			  tempX = 0;
		  }
		  if (tempY < 0)
		  {
			  tempY = 0;
		  }
		  //alert('getMouse x called ' + tempX + ' ' + tempY); 
		}
		function findPos(obj) {
			var curleft = curtop = 0;
			if (obj.offsetParent) {
				curleft = obj.offsetLeft
				curtop = obj.offsetTop
				while (obj = obj.offsetParent) {
					curleft += obj.offsetLeft
					curtop += obj.offsetTop
				}
			}
			return [curleft,curtop];
		}
		var upto=1;
		function fader()
		{
			if(document.getElementById('pop_up'))
			{
				upto -= 0.1;//reduce the opacity setting
				var _li1 = document.getElementById('pop_up');//grab the new
				make_clear(_li1,upto);
				if(upto <= 0.1)//that should be enough
				{
					upto=1;//reset upto(opacity)
					_li1.parentNode.removeChild(_li1);
				}
				else
				{
					fadetimer=setTimeout(fader,33);
				}
			}
		}
	
			
		function make_clear(thething,opa)
		{
			if (ie) // internet explorer
			{
				var ieupto = opa * 100;//ie does this in 100's so X 100
				try
				{
					thething.filters.item("DXImageTransform.Microsoft.Alpha").opacity = ieupto;
				} catch (e) { 
					// If it is not set initially, the browser will throw an error.  This will set it if it is not set yet. 
					thething.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + ieupto + ')';
				}
			}
			else // other browsers
			{
				thething.style.opacity = opa;
			}
		}
	/**
	  *makes a new thing
	  *_thing is the object you want to make

	  *_id sets an id

	  *_name sets name

	  *_class sets the class(note it requires the ie var(ask trev))

	  *probably could be made better with an array(key value)

	  */
		function make_thing(_thing,_id,_name,_class,_htm)
		{
			_thing = document.createElement(_thing);
			if(_class != '' && _class != null)
			{
				_thing.setAttribute(ie ? 'className' : 'class',_class);
			}
			if(_name != '' && _name != null)
			{
				_thing.setAttribute('name',_name);
			}
			if(_id != '' && _id != null)
			{
				_thing.setAttribute('id',_id);
			}
			if(_htm != '' && _htm != null)
			{
				_thing.innerHTML=_htm;
			}
			return(_thing);
		}
			
			
		function _has_shad(_id,_wide,_high)
		{
			
			if(document.getElementById(_id))
			{
				//alert('has shad found');
				var _elm = document.getElementById(_id);
				var _elmW = _wide;
				var _elmH = _high;
				//var _oldelm = _elm.cloneNode(true);
				//var _newE = make_thing('div','wrapp_' + _id);
				//add_style(_newE,_elmW + 9,_elmH + 9,'absolute','0','0','0','0 -9px -9px 0');
				//_newE.appendChild(_oldelm)	
				_do_corner(_elm,2,_elmW,0);
				_do_side(_elm, 11,_elmW,1,_elmH - 11 ,1);
				_do_corner(_elm,_elmH,_elmW,1);
				_do_side(_elm, _elmH,11,2,1,_elmW - 11 );
				_do_corner(_elm,_elmH,1,3);
				//_elm.appendChild(_newE);
			}
		}
	
		
	
		function _do_side(_to, _start,_left,_dir,_h,_w)
	
		{
	
			var i=0;
	
			_start = ie ? _start - 1 : _start;
	
			switch(_dir)
	
			{
	
				case 1:
	
					var _ll = 1;
	
					var _ss = 0;
	
					break;
	
				case 2:
	
					var _ss=1;
	
					var _ll=0;
	
					break;
	
			}
	
			for(i=0; i<9; i++)
	
			{
	
				
	
				var _inner = make_thing('div');
	
				var _afade = ((9 - i) / 10) / 1.2;
	
				add_style(_inner,_w,_h,'absolute',(_start + i * _ss),(_left + i * _ll),'#000000',0);
	
				_inner.style.fontSize = '1px';
	
				make_clear(_inner,_afade);
	
				_to.appendChild(_inner);
	
				
	
			}
	
		}
	
		function _do_corner(_to, _start,_left,_dir)	
		{
			var _matrix = new Array(new Array(1,1,0,0,0,0,0,0,0),new Array(2,2,1,1,0,0,0,0,0),new Array(3,3,2,2,1,0,0,0,0),new Array(4,4,3,3,2,1,0,0,0),new Array(5,5,4,4,3,2,1,0,0),new Array(6,6,5,4,3,2,1,0,0),new Array(7,7,6,5,4,3,2,1,0),new Array(8,8,7,6,5,4,3,2,1),new Array(9,8,7,6,5,4,3,2,1));
			var _i = 0;
			var _inner = 0;
			var _long = _matrix.length;
			var _long1 = _matrix[0].length;
			var _target = _to;
			var _step1 = 1;
			var _step2=1;
			_start = !_start ? 0 : _start;
			_left = !_left ? 0 : _left;
			_start = ie ? _start - 1 : _start;
			switch(_dir)
			{
				case 0:
					_step1=1;
					_step2=1;
					break;
				case 1:
					_step1= -1;
					_start+=_matrix[0].length - 1;
					_step2=1;
					break;
				case 2:
					_step1=1;
					_step2=-1;
					_left+=_matrix.length;
					break;
				case 3:
					_step1= -1;
					_start+=_matrix[0].length - 1;
					_step2=-1;
					_left+=_matrix.length;
					break;
				default:
					_step1=1;
					_step2=1;
					break;
			}
			for(_i=0; _i< _long; _i++)
			{
				for(_inner = 0; _inner < _long1; _inner++)
				{
					var opa = _matrix[_i][_inner];
					if(opa > 0)
					{
						opa = !ie ? (opa / 10) / 1.2 : (opa / 10) / 1.5;
						var _div = make_thing('div');
						add_style(_div,1,1,'absolute',(_i * _step1) + _start,(_inner * _step2) + _left,'#000000',0);
						_div.style.fontSize = '1px';
						make_clear(_div,opa);
						_target.appendChild(_div);
					}
				}
				_inner = 0;
			}
		}
		
	/**
	  *pass an object and get it styled
	  *_div = object
	  *_w = width an number
	  *_h = height number
	  *_p = position 'absolute'
	  *_t = top number
	  *_l = left number
	  *_b = background
	  *_m = margin
	  */
		function add_style(_div,_w,_h,_p,_t,_l,_b,_m)
		{
			if(_w)
			{
				_div.style.width = _w+'px';
			}
			if(_h)
			{
				_div.style.height = _h+'px';
			}
			if(_p)
			{
				_div.style.position = _p;
			}
			if(_t != undefined && _t != '')
			{
				_div.style.top = _t + 'px';
			}
			if(_l != undefined && _t != '')
			{
				_div.style.left = _l + 'px';
			}
			if(_b)
			{
				_div.style.background = _b;
			}
			if(_m)
			{
				_div.style.margin = _m;
			}
		}
	//init		
		//make_win(_name,__url);
		function ___init()
		{
			make_win(el);
			return(false);
	
		}
		___init();
	}
	//end pop up
	
	
	
	
	function __init()
	{
		if(_frm)
		{
		//switch its onsubmit to point at a function
			_frm.onsubmit = final_check;
			if(_divs)
			{
				var i=0;
				for(i=0; i<_divs.length - 1; i++)
				{
					_divs[i].style.display = 'none';
				}
			}
			
			_accom.onclick = toggle_accom;
			_pickup.onclick = toggle_pickup;
			_home.onclick = toggle_stay;
			_away.onclick = toggle_stay;
			_home.checked=false;
			_away.checked = false;
		}
	}
	__init();
}
var xmas = new funny_form();