
function checkform(f) {
  var types = new Array(); 
  var numbers = new Array(); 
  var check_numbers = new Array(); 
  var mesage='';
  
  for (var i = 0; i<f.elements.length; i++) {
    
		if (null!=f.elements[i].getAttribute("check")){
		
			check_numbers[check_numbers.length] = i;
		
			if(null!=f.elements[i].getAttribute("check_type")){
				numbers[numbers.length] = i;
				types[types.length] =  f.elements[i].getAttribute("check_type");
			}
       
		}
	}
	
	for(var i=0; i<check_numbers.length; i++){
	
		if(f.elements[check_numbers[i]].value==''){
			mesage += f.elements[check_numbers[i]].name;
			mesage += '\n';
		}
	}
	
	if(mesage != ''){
		alert("Не заполнены обязательные поля:");
		return false;
	}
	else{
		for(var i=0; i<types.length; i++){
			if(check_case(f, types[i], numbers[i])==false){
				return false;
			}
			
		}
	}
	
 }






function minwidth() {
  if ( (jQuery.browser.msie) && (jQuery.browser.version==6) ) {
    var cssprop = jQuery("#container").css("min-width");
    //if ( cssprop == null ) {
      cssprop = 1150; //No min-width; default to min-width of 760
	  ///
   // } else {
    //  cssprop = parseInt(cssprop); //Convert value to numeric;
   // };
    //get document margin to figure browser width to look for
    var margin = parseInt( jQuery("body").css("margin-left") ) + parseInt( jQuery("body").css("margin-right") );
    //21px is the width of the scroll bar.
	
    if ($(window).width() < (cssprop + margin + 21)) {
      $("#container").css("width", cssprop); //Set fixed-width
    } else {
	
      $("#container").css("width", $(window).width()); //Set fixed-width
    };
  };
};


function setPageHeight(){
	if(document.getElementById("wrap").offsetHeight < document.body.clientHeight){
		
		document.getElementById("wrap").style.height = (document.body.clientHeight-122)+"px";
	}else{
		document.getElementById("wrap").style.height = document.getElementById("wrap").style.height;
	}
}

function main_setPageHeight(){
	if(document.getElementById("main_wrap").offsetHeight < document.body.clientHeight){
		
		document.getElementById("main_wrap").style.height = (document.body.clientHeight-122)+"px";
	}else{
		document.getElementById("main_wrap").style.height = document.getElementById("main_wrap").style.height;
	}
}