$(document).ready(function(){
	$("#viewbasket").click(function(){
		$(".blackback").css("display","block")
		$(".whitebox").css("display","block")
	})		
	$("#closebox").click(function(){
		$(".whitebox").css("display","none")
		$(".blackback").css("display","none")
	})
	$("#recount").click(function(){		
		$.get("/lib/basket.php",{'ID':$(".count:first").attr("prid"),'QUANTITY':$(".count:first").val(),'FUSER':$(this).attr("fuser")},function(response){
			$("#p"+$(this).attr("prid")).text(response)
		})		
	})
$("#PERSONAL_ZIP").focus(function(){
if($(this).val()=='Почтовый индекс'){
	  $(this).val('')
	  $(this).css('color','#000000')		  
  }
})
$("#PERSONAL_ZIP").blur(function(){
if($(this).val()==''){
	  $(this).val('Почтовый индекс')
	  $(this).css('color','#257594')		  
  }
})
$("#PERSONAL_MOBILE").focus(function(){
if($(this).val()=='Мобильный'){
	  $(this).val('')
	  $(this).css('color','#000000')		  
  }
})
$("#PERSONAL_MOBILE").blur(function(){
if($(this).val()==''){
	  $(this).val('Мобильный')
	  $(this).css('color','#257594')		  
  }
})

$("#LAST_NAME").focus(function(){
if($(this).val()=='Фамилия'){
	  $(this).val('')
	  $(this).css('color','#000000')		  
  }
})
$("#LAST_NAME").blur(function(){
if($(this).val()==''){
	  $(this).val('Фамилия')
	  $(this).css('color','#257594')		  
  }
})

$("#SECOND_NAME").focus(function(){
if($(this).val()=='Отчество'){
	  $(this).val('')
	  $(this).css('color','#000000')		  
  }
})
$("#SECOND_NAME").blur(function(){
if($(this).val()==''){
	  $(this).val('Отчество')
	  $(this).css('color','#257594')		  
  }
})

$("#NAME").focus(function(){
if($(this).val()=='Имя'){
	  $(this).val('')
	  $(this).css('color','#000000')		  
  }
})
$("#NAME").blur(function(){
if($(this).val()==''){
	  $(this).val('Имя')
	  $(this).css('color','#257594')		  
  }
})
$("#EMAIL").focus(function(){
if($(this).val()=='Адрес e-mail'){
	  $(this).val('')
	  $(this).css('color','#000000')		  
  }
})
$("#EMAIL").blur(function(){
if($(this).val()==''){
	  $(this).val('Адрес e-mail')
	  $(this).css('color','#257594')		  
  }
})
$("#NAME").focus(function(){
if($(this).val()=='Имя'){
	  $(this).val('')
	  $(this).css('color','#000000')		  
  }
})
$("#NAME").blur(function(){
if($(this).val()==''){
	  $(this).val('Имя')
	  $(this).css('color','#257594')		  
  }
})
$("#NAME").focus(function(){
if($(this).val()=='Имя'){
	  $(this).val('')
	  $(this).css('color','#000000')		  
  }
})
$("#NAME").blur(function(){
if($(this).val()==''){
	  $(this).val('Имя')
	  $(this).css('color','#257594')		  
  }
})

})
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

