function new_zakaz(id){
	document.getElementById('zakaz').style.display='block';
	document.getElementById('zakaz').innerHTML='<img src="/zakaz/load.gif" style="margin:30px 250px 30px 0">';
	var xmlhttp = getXmlHttp();

	var url = 'http://' + document.domain + '/zakaz/ajax.php?action=zakaz_block_text&id=' + id;

	xmlhttp.open('GET', url, true);

	xmlhttp.send(null);

	xmlhttp.onreadystatechange = function() {

		if (xmlhttp.readyState == 4) {

			if(xmlhttp.status == 200) {

				document.getElementById('zakaz').innerHTML = xmlhttp.responseText;

			}

		}

	};
}



function ch(id){

    summa = document.getElementById('total');



    if ( id == 1 )

    {
        c1 = 7;

        c2 = 2;

        total = 2.5;

    }



    if ( id == 2 )

    {
    	c1 = 1.5;

        c2 = 1.5;

        total = 3;

    }



    if ( id == 3 )

    {

    	c1 = 5;

        c2 = 2;

        total = 10;

    }



    if ( id == 4 )

    {

    	c1 = 5;

        c2 = 2;

        total = 8;

    }



    if ( id == 5 )

    {

    	c1 = 43;

        c2 = 5;

        total = 40;

    }



    if ( id == 6 )

    {

    	c1 = 43;

        c2 = 10;

        total = 50;

    }



    if ( id == 7 )

    {

    	c1 = 10;

        c2 = 2;

        total = 11;

    }



    if ( id == 8 )

    {

    	c1 = 10;

        c2 = 2;

        total = 11;

    }



    if ( id == 9 )

    {

    	c1 = 29;

        c2 = 5;

        total = 8.99;

    }



    if ( id == 10 )

    {

    	c1 = 10;

        c2 = 5;

        total = 15;

    }



    if ( id == 11 )

    {

    	c1 = 10;

        c2 = 2;

        total = 25;

    }



    if ( id == 12 )

    {

    	c1 = 32;

        c2 = 5;

        total = 65;

    }

    if ( id == 14 )

    {

    	c1 = 10;

        c2 = 2;

        total = 2;

    }

    if ( id == 15 )

    {
        c1 = 0;

        c2 = 2;

        total = 6;

    }



    //total = 2.5;



    if( document.getElementById("ch1").checked )

    {

        total = total + c1;

    }



    if( document.getElementById("ch2").checked )

    {

        total = total + c2;

    }



    summa.innerHTML = total;



}





function close_zakaz(){

	document.getElementById('zakaz').style.display='none';

	//document.body.style.overflow='auto';

	//document.body.style.postiton='auto';

	//document.getElementById('header_bg').style.display='block';

}



function z_send(id){

	var error = 0;



	if(error == 0 && document.getElementById('url').value == ''){

		alert('Вы не ввели url');

		error = 1;

	}



	if(id == 2){

		if(error == 0 && document.getElementById('url_rss').value == ''){

			alert('Вы не ввели url RSS');

			error = 1;

		}

	}



	if(error == 0 && document.getElementById('mail').value == ''){

		alert('Вы не ввели email');

		error = 1;

	}



	if(id == 4){

		if(error == 0 && document.getElementById('addr').value == ''){

			alert('Вы не ввели адрес');

			error = 1;

		}



		if(error == 0 && document.getElementById('phone').value == ''){

			alert('Вы не ввели телефон/факс');

			error = 1;

		}

	}







	if(error == 0) document.getElementById('z_form').submit();

}



function getXmlHttp(){

	var xmlhttp;

	try {

		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

	} catch (e) {

		try {

			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

		} catch (E) {

			xmlhttp = false;

		}

	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {

		xmlhttp = new XMLHttpRequest();

	}

	return xmlhttp;

}
