function my_confirm(hrf, text){
	if (confirm(text)) {
		parent.location=hrf;
		return true;
	}
	else {
		return false;
	}
}


function MakeAction(val){
	val=document.Former.ptype.value;
	if (val==1 || val==0){
		document.Former.ptime.disabled=false;
	}
	else if (val==2){
		document.Former.ptime.disabled=true;
	}
}

function Click(put){	
	if (put==""){}
	put="products/"+put;
	if (document.images)
	{
		var imgClick = new Object();
		imgClick["image"] = new Image();
		imgClick["image"].src = put;
	}
	if(document.getElementById)
		document.getElementById("image").src = imgClick["image"].src;
	
}



function Show(obj){
	var theObj = getObject(obj);
	
	if (typeof theObj.visibility != "undefined")
		theObj.visibility = "visible";
	if (typeof theObj.display != "undefined")
		theObj.display = "block";
}

function Shw(obj){
	obj=document.getElementById(obj);
}


function getObject(obj){
	var theObj;
	if (document.layers)
	{
		if (typeof obj=="string") return documents.layers[obj];
		else return obj;
	}
	if (document.all)
	{
		if (typeof obj == "string")
		{
			if (document.all(obj)!=null) return document.all(obj).style;
			else return null;
		}
		else return obj.style;
	}
	if (document.getElementById)
	{
		if (typeof obj == "string")
			return document.getElementById(obj).style;
		else return obj.style;
	}
return null;
}

	
function Close(obj){
	var theObj = getObject(obj);
	if (typeof theObj.visibility != "undefined")
		theObj.visibility = "hidden";
	if (typeof theObj.display != "undefined")
		theObj.display = "block";
		Click("null.jpg");
}


function ChangeText(name, about, price, height, width, length, weight, count, order, type, time){
	price=price+" руб.";
	if (type=="2"){type="Готовый товар";}
	else if (type=="1"){type="В процессе разработки";}
	else if (type=="0"){type="Разработка на заказ";}
	document.getElementById("pName").innerHTML = name;
	document.getElementById("pAbout").innerHTML = about;
	document.getElementById("pPrice").innerHTML = price;
	document.getElementById("pCount").innerHTML = count;
	document.getElementById("pParam").innerHTML = "<font size=1 color=#C0C0C0>Вес (гр) -</font>"+weight+"<br><font size=1 color=#C0C0C0>Высота (мм)- </font>"+height
													+"<br><font size=1 color=#C0C0C0>Ширина (мм)- </font>"+width+"<br><font size=1 color=#C0C0C0>Длина (мм)- </font>"+length; 
	document.getElementById("pOrder").innerHTML = order;
	document.getElementById("pType").innerHTML = type;
	
}


function PreloadImgs() {
 var d=document,a=arguments; 
 
 if(!d.FP_imgs) {
 	d.FP_imgs=new Array();
 }
 for(var i=0; i<a.length; i++) { 
 	d.FP_imgs[i]=new Image; 
 	d.FP_imgs[i].src=a[i]; 
 }
}
