function item_type_delete_confirm(id)
{
var answer=""
var answer=prompt("ВНИМАНИЕ ! При удалении признака продукции будут потеряны все предметы, к нему принадлежащие. Чтобы удалить наберите 'yes'",'')
if ( answer == "yes")
{parent.location="./admin.php?part=admin_item_type&submit_delete=yes&id="+id}
}


function pop_up_old(url,width,height,size,scroll) {
        newWin = window.open(url, "pop", "width="+ width +",height="+ height +",toolbar=no,menubar=no,location=no,scrollbars="+ scroll +",resizable=yes");
	newWin.focus();
}

function pop_up(url,width,height,size,scroll)
{
    var left=(window.screen.width/2)-(width/2);
    var Top=(window.screen.height/2)-(height/2);

        var now=new Date();
        var num=(now.getSeconds())%1000;
        newWin = window.open(url, num, "width="+ width +",height="+ height +",toolbar=no,menubar=no,Left="+left+",Top="+Top+",location=no,scrollbars="+ scroll +",resizable=yes");
        newWin.focus();
}


function windowOpen(url, breite, hoehe, name){
	parameter="dependent=yes,directories=no,fullscreen=no,height=";
	parameter += hoehe;
	parameter +=",width=";
	parameter += breite;
	parameter +=",hotkeys=no,left=10,right=10,location=no,menubar=no,personalbar=no,resizabel=no,screenX=10,screenY=10,status=yes,titelbar=yes,toolbar=no,top=10";
	window.open(url,name,this.parameter);
	return false;
}

function getnews(id)
{
        Now = new Date();
        var URL = "./get_news.php?news_id="+id
        URL += "&"+Now.getDate()+Now.getMonth()+Now.getFullYear()
        URL += Now.getHours()+Now.getMinutes()+Now.getSeconds()
        if ( navigator.appName == "Microsoft Internet Explorer" )
        window.open(URL,'thewindow',config='height=150,width=350,scrollbars=1');
       	if ( navigator.appName == "Netscape" )
        window.open(URL,"thewindow","outerHeight=150, outerWidth=350, alwaysRaised=1");
}

function checkUP(form)
{
        if (form.user_name.value.length < 6) {
                alert('Please fill in a user name with at least 6 characters!');
                return false;}
        if (form.pass.value.length < 5) {
                alert('Please fill in a password with at least 5 characters!');
                return false;}
        return true;
}


function add_item_type(new_pos,item_type_id,level_id)
{
var new_pos = prompt("Позиция", new_pos);
var name = prompt("Название", "");
//var page = document.location;
var page = "./admin.php?part=admin_item_type";
parent.location=page + "&submit_add=yes" + "&position=" + new_pos + "&id=" + item_type_id + "&level_id=" + level_id+ "&name=" + name;
}

function change_item_type(pos,id,name)
{
var pos = prompt("Позиция", pos);
var name = prompt("Название", name);
var page = "./admin.php?part=admin_item_type";
parent.location=page + "&submit_change=yes" + "&position=" + pos + "&id=" + id + "&name=" + name;
}

function window_close_1()
{
var page = "./admin.php?part=admin_news";
//document.window.admin_main_w.location=page+"&555=555";
//parent.location=parent.location+"&555=555";
//window('adminw').location=page+"&555=555";
window.parent.location=page+"&555=555";
window.close();
}
function f1(n, url){
	top.top_fr.document.head.GotoFrame(n-1);
	//if (! url=='') { document.location = url};
	document.location = url
}

function showmessage(q)
{
  if (q==1) alert('You are not logged in');
  if (q==2) alert('You are already logged in');
  return false;
}

function clear_cart(s)
{
        var info = "";
        info += s;
        if (confirm("Do you really want to clear your cart?"))
          parent.location = info;
}

function get_news(id)
{
        Now = new Date();
        var URL = "./get_news.php?news_id="+id
        URL += "&"+Now.getDate()+Now.getMonth()+Now.getFullYear()
        URL += Now.getHours()+Now.getMinutes()+Now.getSeconds()
//        if ( navigator.appName == "Microsoft Internet Explorer" )
        window.open(URL,'thewindow',config='height=150,width=350,scrollbars=1');
//        if ( navigator.appName == "Netscape" )
//        window.open(URL,"thewindow","outerHeight=150, outerWidth=350, alwaysRaised=1");
}

function maker_select(part)
{
var anons="777";
//global anons;
//anons="55555";
//return anons;
window.location = "./index.php?part="+part+"&new_maker_id="+document.new_message.message_maker_id.value;
}

function treeExpand(oObj, trname) {
	tr = document.getElementById(trname);
	var d, s;
	var img	= oObj.cells[0].firstChild.firstChild;
	if (tr.style.display == '')			{
		d	= 'none';	/*s	= img.src.replace("opened", "closed");*/} else
	{	d	= '';		/*s	= img.src.replace("closed", "opened");*/}
	tr.style.display	= d;
//	img.src	= s;
//	img.parentNode.setAttribute("href", "#");
	return true;
}
function treeExpand2(oObj, trname) {
	tr = document.getElementById(trname);
	var d, s;
	var img	= oObj.cells[0].firstChild.firstChild;
	if (tr.style.display == '')			{
		d	= 'none';	s	= img.src.replace(/opened/g, "closed");} else
	{	d	= '';		s	= img.src.replace(/closed/g, "opened");}
	tr.style.display	= d;
	img.src	= s;
	img.parentNode.setAttribute("href", "#");
	return true;
}

function win_reload(s,part)
{
//s.options[s.selectedIndex].value;
window.location='index.php?part=' + part + '&town_id=' + s.options[s.selectedIndex].value
}

function model_loader_ollllllllllllllllld(s)
{

//<?php include('make_model_list.php');?>


model_array_1 = new Array("Nokia5210", "Nokia5110", "Nokia1010", "Nokia8810")
model_array_2 = new Array("Sim1", "Sim2", "Sim3")
model_array_3 = new Array("Moto")
new_message.item_id.options.length=0;
 for (var i=0; i < eval("model_array_" + s.options[s.selectedIndex].value).length; i++) {
var attt = new Option;
new_message.item_id.options[i] = attt;
new_message.item_id.options[i].text  = eval("model_array_" + s.options[s.selectedIndex].value) [i];
                           }

//new_message.item_id.options[0].text  = '999';
//new_message.item_id.options[0].value  = '111';

}


function pop_up_resizable(url,width,height,size,scroll)
{
        var now=new Date();
        var num=(now.getSeconds())%1000;
        newWin = window.open(url+"&popup=yes", num, "width="+ width
+",height="+ height +",toolbar=no,menubar=no,location=no,scrollbars="+
scroll +",resizable=yes");
 newWin.focus();
}
