// Pull the Trigger Functions [Mootools]
function initPullTheTrigger() {
	if(navigator.appName.indexOf('Netscape') != -1) {
		//document.styleSheets[0].insertRule("html { overflow-y:scroll; }",0);
	}
	var ptt = document.getElementById('pullTheTrigger').getElementsByTagName('a')[0];
	ptt.onclick = function() { openPTT(); };
	
	ptt.href = 'javascript:void(null);';
}

function openPTT() {
	document.getElementById("flash_logo").style.display = "none";
	document.getElementById("iamge_logo").style.display = "block";
	
		//var pageMask = document.createElement('div');
		//	pageMask.id = 'masker';
		//	document.body.appendChild(pageMask);
		var pageMask = document.getElementById('masker');
			pageMask.style.position = 'absolute';
			pageMask.style.zIndex = '900';
			pageMask.style.left = '0';
			pageMask.style.top = '0';
				
			//varianta noua
			pageMask.style.width = (document.body.clientWidth) + 'px';
			pageMask.style.height = '2500px';
			
			pageMask.style.visibility = 'hidden';
			pageMask.style.background = '#ffffff';
			
		document.body.style.overflow = 'hidden';
		document.body.style.overflow = '';
		new Fx.Style('masker','opacity',{
					 duration:500,
					 onComplete:function(){
						var pttForm = document.getElementById('pullTheTrigger_form');
							pttForm.style.visibility = 'hidden';
							pttForm.style.left = '50%';
							new Fx.Style('pullTheTrigger_form','opacity',{
										 duration:500,
										 onComplete:function(){
											 pttForm.style.visibility = 'visible';
											 pttForm.style.display = 'block';
										 }}).custom(0,1);
					  },
					  onStart:function() {
							// Internet Explorer has problems with z-indexing drop-downs so we have to fix that...
							var selects = document.getElementsByTagName('select');
							
							for(z=0;z<selects.length;z++) {
								selects[z].style.visibility = 'hidden';
							}
					  }
					  }).custom(0,0.5);
}

function closePTT() {
	document.getElementById("flash_logo").style.display = "block";
	document.getElementById("iamge_logo").style.display = "none";

	var pttForm = document.getElementById('pullTheTrigger_form');
	var pageMask = document.getElementById('masker');
	
			
		new Fx.Style('masker','opacity',{duration:500}).custom(0.5,0);
		new Fx.Style('pullTheTrigger_form','opacity',{duration:500,onComplete:function(){
						//pageMask.parentNode.removeChild(pageMask);
						pageMask.setAttribute('style','');
						pageMask.removeAttribute('style');
						document.getElementById('ptt_form').reset();
						document.body.setAttribute('style','');
						document.body.removeAttribute('style');
						// Internet Explorer has problems with z-indexing drop-downs so we have to fix that...
						var selects = document.getElementsByTagName('select');
						for(z=0;z<selects.length;z++) {
							selects[z].style.visibility = 'visible';
						}
					}}).custom(1,0);
}

function submitContact() {
	xajax_formSubmit(xajax.getFormValues('ptt_form'));
}