function openImage(image) {
	window.open("/popup.php?img="+image, "popupimage", "scrollbars=0, resizable=1, width=520, height=450").focus();
}
 
function Preload() {
	b=Preload.arguments; 
	preload_images = new Array();
	for(i=0; i<b.length; i++) {
		preload_image = new Image;
		preload_image.src=b[i];
		preload_images[i]=preload_image;
	}
}

function ChRImg(obj,url,activated) {
	if (activated=='1') return;
	if (!obj) return;
	obj.firstChild.src='/images/home_buttons/'+url+'.gif';
}

function ChImg(obj,act,activated) {
	if (activated=='1') return;
	if (!obj) return;
	obj.className='topmenu'+act;
	obj.firstChild.src='/images/arrow2'+act+'.gif'; 
}

function ChBImg(obj,url,activated) {
	if (activated=='1') return;
	if (!obj) return;
	obj.firstChild.src='/images/buttons_menu/'+url+'.gif';
}

function ChOrderImg(obj,act,step,activated) {
	if (activated=='1') return;
	if (!obj) return;
	obj.firstChild.src='/images/order_menu/step'+step+act+'.gif'; 
}

function ChClass(obj,act,activated) {
	if (activated=='1') return;
	if (!obj) return;
	obj.className='menu_bg'+act; 
	div=obj.all(0);
	div.className='menu_e_bg'+act;
	div.all(0).className='menu_sh'+act;
	div.all(1).className='menu'+act;
}

function openMod(id) {
	if (!id) return;
	window.open("/modpopup/"+id, "popupimage", "scrollbars=1, resizable=0, width=520, height=450").focus();
}

function openTpl(tpl,n) {
	if (!tpl||!n) return;
	window.open("/tplpopup/?tpl="+tpl+"&n="+n, "popupimage", "scrollbars=0, resizable=0, width=520, height=450").focus();
}

function calc() {
	sum=0;
	for (key in ids) {
		if (document.getElementById('mod'+ids[key]).checked) sum += prices[key];
	}
/*	for (key in dom) {
		if (document.getElementById('domain'+dom[key]).checked) sum += dprices[key];
	}
	for (key in host) {
		if (document.getElementById('hosting'+host[key]).checked) sum += hprices[key];
	}
*/
	document.getElementById('result').innerHTML= sum + ' ó.e.';
}

function ChBox(id,act) {
	if (id_act==id&&act=='') return;
	obj=document.getElementById('obox'+id);
	obj.className='obox'+act;
	obj.firstChild.className='ibox'+act;
	document.getElementById('ttitle'+id).className='ttitle'+act;
	document.getElementById('tcircle'+id).className='tcircle'+act;
}

function SelectBox(id) {
	id_act=0;
	for (key in ids) { 
		ChBox(ids[key],'');
	}
	ChBox(id,'1');
	id_act=id;
	for (key in ids) { 
		if (document.getElementById('template'+ids[key])!=null) {
			document.getElementById('template'+ids[key]).style.display='none';
			document.getElementById('ttitle'+ids[key]).className='ttitle';
			document.getElementById('tcircle'+ids[key]).className='tcircle';
			document.getElementById('desc'+ids[key]).style.display='none';
		}
	}
	if (document.getElementById('template'+id)!=null) {
		document.getElementById('template'+id).style.display='block';
		document.getElementById('ttitle'+id).className='ttitle1';
		document.getElementById('tcircle'+id).className='tcircle1';
		document.getElementById('desc'+id).style.display='block';
	}
}

function ChCBox(tpl,n,act) {
	if (eval("id_act_"+tpl)==n&&act=='') return;
	obj=document.getElementById('obox_'+tpl+'_'+n);
	if (obj==null) return;
	obj.className='obox'+act;
	obj.firstChild.className='ibox'+act;
}

function SelectCBox(tpl,n) {
	eval("id_act_"+tpl+"=0;");
	for (key in eval("ids_"+tpl)) { 
		ChCBox(tpl,eval("ids_"+tpl+"["+key+"]"),'');
		document.getElementById('ccolor_'+tpl+'_'+eval("ids_"+tpl+"["+key+"]")).checked=false;
		document.getElementById('tplimg_'+tpl+'_'+eval("ids_"+tpl+"["+key+"]")).style.display='none';
	}
	ChCBox(tpl,n,'1');
	if (document.getElementById('ccolor_'+tpl+'_'+n)!=null) {
		document.getElementById('ccolor_'+tpl+'_'+n).checked=true;
	}
	document.getElementById('tplimg_'+tpl+'_'+n).style.display='block';
	eval("id_act_"+tpl+"="+n+";");
}

