window.onload= function(){
	var objBody = document.getElementById("FonBl");	
	var objCallBack = document.createElement("div");
		objCallBack.setAttribute('id','CallBack');
		objCallBack.style.display = 'none';
		objCallBack.style.position = 'absolute';	
		objCallBack.style.width = '356px';	
		objCallBack.style.height = '214px';				
		objBody.appendChild(objCallBack);	
};
function CallBack(sc,e){

	document.getElementById("CallBack").innerHTML='<iframe style="position:relative; z-index:10000;" src="/'+sc+'" allowtransparency="true"  hspace="0" marginheight="0" marginwidth="0" vspace="0" scrolling="no" width="356" align="left" frameborder="0" height="214"></iframe>';
	document.getElementById("CallBack").style.display="block";
}	

function getClientSize(){
		return {
				'x' : document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth,
				'y' : document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight
		}
};	
function menuover(obj){
    if(document.getElementById("s"+obj).style.display=='block') {
	   document.getElementById("s"+obj).style.display='none';   
	   document.getElementById("a"+obj).style.background='url(../images/RowCat.gif) no-repeat left';   	   
	}   
	else {
	   document.getElementById("s"+obj).style.display='block';
	   document.getElementById("a"+obj).style.background='url(../images/RowCat_a.gif) no-repeat left';  	   
	}   
};

function CheckFormCupon(){
   if(document.getElementById('_fullname').value=="") {
      alert("Введите имя!");
   }	  
   else{
      if(document.getElementById('_phone').value=="") alert("Введите номер телефона!"); 
	  else{
	 new Ajax.Request('/checkkupon/', {
		method: 'post',
		parameters: $('FormCupon').serialize(),
	      onSuccess: function(transport) {
	        if (transport.responseText=='ok'){
			   location.href="/kupon";				  
	        }else
			   alert(transport.responseText);
            }
            } );
	  }
   }   
}

