x='1';

function ttt() {

	if (x=='2') { 
		document.getElementById('card').style.backgroundImage='url(img/card_side_1.jpg)';
		x='1'; 
	} else {
		document.getElementById('card').style.backgroundImage='url(img/card_side_2.jpg)';
		x='2';
	}
}



window.onresize = rubber;

function rubber() {

	var main_table = document.getElementById('main_table');
	if (getClientWidth()>=1380) {
		main_table.style.width = '1380px';
	} else {
		if (getClientWidth()>=990) { 
			main_table.style.width = '100%';
		} else {
			main_table.style.width = '990px';
		}		
	}
}

function getClientWidth() { return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth; }
function getClientHeight() { return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight; }

function checkRequiredFields(frm)
{
    var emptyFields = ""; //Перечень пустых полей 
 
    for( var i = 0; i < frm.elements.length; i++)
        if(null != frm.elements[i].getAttribute("required")) //Если текущее поле помечено, проверяем на пустоту
		    if(checkEmptiness(frm.elements[i].value) )
                emptyFields += " "+frm.elements[i].getAttribute("runame") + "\n";
 
    if("" != emptyFields)
        {
            alert("Необходимые поля не заполнены: \n" + emptyFields);
            return false;
        }
    else return true;
}

function checkEmptiness(str)
{
    //Проверка на наличие пустой строки
    for(var i = 0; i < str.length; i++)
        if(" " != str.charAt(i)) return false;
 
    return true;
}


