function DisplayFlash(path, width, height, wmode){

    text = "<object type=\"application/x-shockwave-flash\" data=\""+path+"\" width=\""+width+"\" height=\""+height+"\" wmode=\""+wmode+"\" quality=\"high\" allowScriptAccess=\"always\">\r\n";
    text += "<param name=\"movie\"	value=\""+path+"\" />\r\n";
    text += "<param name=\"wmode\" value=\""+wmode+"\" />\r\n";
    text += "<param name=\"quality\" value=\"high\" />\r\n";
    text += "<param name=\"allowScriptAccess\" value=\"always\" />\r\n";    
    text += "<param name=\"width\" value=\""+width+"\" />\r\n";
    text += "<param name=\"height\" value=\""+height+"\" />\r\n";
    text += "</object>";
    document.write(text);
}


function openWind(url,width,height) {
        number = Math.round(Math.random() * 100000000);
        auxWnd = window.open(url, 'newWindow_' + number,'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=1,scrollprint=yes,toolbar=no,menubar=no,location=no,status=no,directories=no,copyhistory=no,left=0,top=0');
}

function onAddToOrderSuccess(data)
{
 	if(data){
		alert('Наименование добавлено в корзину');
		$("#cart").html(data);
	}
	else
		alert('Вы не выбрали товар!');
}


function AddToOrder(item) {
	$.get('/includes/js/order.php', {action: "addtoorder", item: item, itemscount: 1}, onAddToOrderSuccess);
}


function onGetOrderSuccess(data) {

	var ss = data.split("++");
	$("#cart").html(ss[0]);
	$("#orderbody").html(ss[1]);
}


function GetOrder(action) {

	var items = "";

	if(action=="0")
		action = "recalc";


	var elements = $("#orderbody").find("table.data").find("input:text");

	for (var i = 0; i < elements .length; i++){
		items += elements[i].name+"-"+elements[i].value+" ";
	}


	var delitems = "";
	var inputs = document.item.getElementsByTagName('input');
	for (var i = 0; i < inputs.length; i++){
        	if(inputs[i].checked&&inputs[i].name!='face')
                        delitems = delitems+" "+inputs[i].name;

	}


	$.get('/includes/js/order.php', {items: items, delitems:delitems, action: action}, onGetOrderSuccess);
}

