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 Change(id, put){	
	if (put==""){}
	put=put;
	if (parent.document.images)
	{
		var imgClick = new Object();
		imgClick[id] = new Image();
		imgClick[id].src = put;
	}
	if(parent.document.getElementById)
		parent.document.getElementById(id).src = imgClick[id].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 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";
}


function MakeGraph(num){
	var img1 = Math.random();
	var img2 = Math.random();
	img1=img1*10-(img1*10)%1;
	img2=img2*10-(img2*10)%1;
	img=img1+img2;
	put = "pictures/auto/"+img+".jpg";

	if (document.images)
	{
		var imgClick = new Object();
		imgClick["graph"] = new Image();
		imgClick["graph"].src = put;
	}
	if(document.getElementById)
		document.getElementById("graph").src = imgClick["graph"].src;
}



function getNumber(){
	var coe1, coe2, coe3;
	coe1=19;
	coe2=3;
	coe3=21;
	var i1, i2, i3, i4, i5;
	var intCode = new Array;

	i1 = Math.random(coe1+coe2*coe3);
	intCode[0]=i1*10 - (i1*10)%1;
	
	i2 = Math.random(coe1-coe3/coe2);
	intCode[1]=i2*10 - (i2*10)%1;
	
	i3 = Math.random(coe1*coe2/coe3);
	intCode[2]=i3*10 - (i3*10)%1;	
	
	i4 = Math.random((coe1+coe2)-coe3);
	intCode[3]=i4*10 - (i4*10)%1;
	
	i5 = Math.random(coe1/(coe3-coe2));
	intCode[4]=i5*10 - (i5*10)%1;
 			
	var src1, src2, src3, src4, src5;		
	
	src1 = ("picts/iCode/"+intCode[0]+".jpg");
	src2 = ("picts/iCode/"+intCode[1]+".jpg");
	src3 = ("picts/iCode/"+intCode[2]+".jpg");		
	src4 = ("picts/iCode/"+intCode[3]+".jpg");
	src5 = ("picts/iCode/"+intCode[4]+".jpg");
				
	if (document.images){
		var imgGet = new Object();
		imgGet["img1"] = new Image();
		imgGet["img1"].src = src1;
	
		imgGet["img2"] = new Image();
		imgGet["img2"].src = src2;
		
		imgGet["img3"] = new Image();
		imgGet["img3"].src = src3;
		
		imgGet["img4"] = new Image();
		imgGet["img4"].src = src4;	
				
		imgGet["img5"] = new Image();
		imgGet["img5"].src = src5;
	}

	if(document.getElementById){
		document.getElementById("img1").src = imgGet["img1"].src;
		document.getElementById("img2").src = imgGet["img2"].src;
		document.getElementById("img3").src = imgGet["img3"].src;
		document.getElementById("img4").src = imgGet["img4"].src;
		document.getElementById("img5").src = imgGet["img5"].src;
	}
	var Code;
	Code = intCode[0]+intCode[1]+intCode[2]+intCode[3]+intCode[4];
	var today = new Date();
	return Code;
}


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]; 
 }
}


function GetVis(){
	fu = document.getElementById("1");
	if (fu.style.visibility=="hidden"){
		fu.style.visibility="visible";
	}
	else {
		fu.style.visibility="hidden";
	}
}


function MakeForm(){
	val=document.addnew.whatact.value;
	if (val=="video"){
		document.addnew.href.disabled=false;
		document.addnew.file.disabled=true;
		document.addnew.href.value="";
		document.addnew.about.rows=2;
		document.addnew.href.rows=2;
	}
	else if (val=="jokes" || val=="story" || val=="toast"){
		document.addnew.href.disabled=true;
		document.addnew.file.disabled=true;
		document.addnew.about.rows=10;
		document.addnew.href.rows=1;
	}
	else if (val=="ero" || val=="funny" || val=="beaut" || val=="flash"){
		document.addnew.href.disabled=true;
		document.addnew.file.disabled=false;
		document.addnew.about.rows=2;
		document.addnew.href.rows=1;
	}
}

function GetVis(){
	fu = document.getElementById("l1");
	fu.style.visibility = visible;
}
