function mqRotate(mqr){
	if (!mqr) return;
	for (var j=mqr.length - 1; j > -1; j--) {
		maxa = mqr[j].ary.length;
		for (var i=0;i<maxa;i++){
			var x = mqr[j].ary[i].style; 
			x.left=(parseInt(x.left,10)-1)+'px';
		}
		var y = mqr[j].ary[0].style;
		if (parseInt(y.left,10)+parseInt(y.width,10)<0){
			var z = mqr[j].ary.shift();
			z.style.left = (parseInt(z.style.left) + parseInt(z.style.width)*maxa) + 'px';
			mqr[j].ary.push(z);
		}
	}
	mqr[0].TO=setTimeout('mqRotate(mqr)',30);
}

function fail(y){
				y.className = 'error';
				return false;
			}
			
			function validate_form(o){
				e = true;
				var a = new Array(o.name, o.type, o.yog, o.shop, o.location, o.birthday, o.email, o.password, o.phone, o.carrier, o.customSMS);
				for(b=0; b < a.length; b++){
					f = a[b];
					r = f.value;
					y = document.getElementById(f.name+'Error');
					y.className = 'clear';
					switch(f.name){
						case 'name':
						case 'location':
							if(r.trim().length == 0 || r.trim().indexOf(' ') == -1) e = fail(y);
							break;
						case 'yog':
						case 'shop':
							if(o.type.selectedIndex == 1 && f.selectedIndex == 0) e = fail(y);
							break;
						case 'password':
							if(r.trim().length == 0) e = fail(y);
							break;
						case 'type':
							if(f.selectedIndex == 0) e = fail(y);
							break;
						case 'birthday':
							if(!r.match(/^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/)) e = fail(y);
							break;
						case 'email':
							if(!r.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)) e = fail(y);
							break;
						case 'phone':
							if(!r.match(/^\(?[2-9]\d{2}[\)\.-]?\s?\d{3}[\s\.-]?\d{4}$/)) e = fail(y);
							break;
						case 'carrier':
							if(o.textAlert.checked && f.selectedIndex == 0) e = fail(y);
							break;
						case 'customSMS':
							if(o.textAlert.checked && o.carrier.selectedIndex == 1 && !r.match(/^([0-9_\.\-]{10,12})+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)) e = fail(y);
							break;
					}
				}
				return e;
			}
			
			function popUp(node){
				node.style.display = 'block';
				var pop = new Fx.Morph(node, {duration: 500, transition: Fx.Transitions.Sine.easeIn});
				offset = node.firstChild.offsetHeight;
				heightTo = (node.style.height.substr(0, node.style.height.length-2) == offset) ? '0' : offset;
				pop.start({'height': heightTo});
			}
