function confirmDelete(myform) {
	if (confirm('You are real?')) myform.submit();
	else return false;
};

function ConfirmMarketingDelete(id) {
	if (confirm("Are you sure you wish to delete this PDF?"))
		document.location.href = "admin.php?do=market_Delete&id=" + id + "&page=Literature";
};


function OpenWindow(url, width, height, scrolling)	{
    var left = (screen.width  - width)  / 2;
	var top = (screen.height - height) / 3;
	window.open(url, "wnd", "width="+width+", height="+height+", top="+top+", left="+left+", toolbar=no, location=no, menubar=no, resizeable=no, scrollbars="+scrolling);
};

function SelectAll(myform) {
	for (i = 0; i < myform.elements.length; i++)
		if (myform.elements[i].name=='id[]') myform.elements[i].checked=myform.sample.checked;
};

function changeAction(myform, action) {
	myform.elements['do'].value=action;
//	myform.elements[0].value=action;
	if (action.indexOf('delete')==-1) myform.submit();
	else if (confirm('Are you sure?')) myform.submit();
};

function checkSelected(myform, element) {
	i=0;
	flag=false;
	while (i<myform.elements.length && !flag) {
		if (myform.elements[i].name==element && myform.elements[i].checked==true) {
			flag=true;
		};
		i++;
	};
	if (!flag) {
		alert('No object was selected for removal or update');
	};
	return flag;
};

<!--проверяет выходит ли за границу диапазона//-->
function checkRange(element, up) {
	if (element.value<1 || element.value>parseInt(up)) {
		alert("Error in Quantity!");
		element.value=up;
	};
};

function addToCompare(myform) {
	flag=myform.size.value;
	for (i=0; i<myform.elements.length; i++) {
		if (myform.elements[i].name=='id[]' &&
			myform.elements[i].type=='checkbox' &&
			myform.elements[i].status==true &&
			myform.elements[i].name!='sample') {
			flag++;
		};
	};

	if (flag<6) {
		changeAction(myform,'addToCompare');
		myform.submit();
	} else {
		alert("You must select only to 5 projectors  to compare!")
	};
};

<!--Отправляет форму для сравнения проекторов//-->
function compareProjectors(myform) {
	flag=0;
	for (i=0;i<myform.elements.length;i++) {
		if (myform.elements[i].name=='id[]' &&
			myform.elements[i].type=='checkbox' &&
			myform.elements[i].status==true &&
			myform.elements[i].name!='sample') {
			flag++;
		};
	};

	if (flag>1 && flag<6) {
		changeAction(myform,'compareProjectors');
		myform.submit();
	} else {
		alert("You must select only from 2 to 5 projectors  to compare!")
	};
};

<!--Загрузка картинок//-->
function imgAct(imgName) {
    if (document.images) {
        document[imgName].src = eval(imgName + "on.src");
    }
};
function imgInact(imgName){
    if (document.images) { 
        document[imgName].src = eval(imgName + "off.src");
    }
};
function setTitle(title) {
	document.title=document.title+' > '+title;
};

function LaunchDealerStore() {
		window.open('storedealer.php','dealeroptions','menubar=0,toolbar=0,width=850,height=600,resizable=1,scrollbars=1');
}