// JavaScript Document

function changeText(alias,tn,table_id){
	if(tn!=undefined) {tn="&tn="+tn;}
	else {tn="";}
	
	if(table_id!=undefined) {table_id="&table_id="+table_id;}
	else {table_id="";}
	window.open('/ll/_texts?alias='+alias+tn+table_id,'CMS1', 'left=120,top=50,width=940,height=670,toolbar=0,resizable=1,scrollbars=1');
}

function changeTree(id,parent){
	if(parent!=undefined) {parent="&parent="+parent;}
	else {parent="";}
	window.open('/ll/_change_tree?id='+id+parent,'treeCMS', 'left=120,top=50,width=600,height=450,toolbar=0,resizable=1,scrollbars=1');
}

function changeGalleries(id,ptable,pid,tips){
	if(ptable!=undefined) {ptable="&ptable="+ptable;} else {ptable="";}
	if(pid!=undefined) {pid="&pid="+pid;} else {pid="";}
	if(tips!=undefined) {tips="&tips="+tips;} else {tips="";}	
	window.open('/ll/_gallery_edit?id='+id+ptable+pid+tips,'galleriesCMS1', 'left=120,top=50,width=510,height=390,toolbar=0,resizable=1,scrollbars=1');
}

function changeNews(id,parent){
	if(parent!=undefined) {parent="&parent="+parent;}
	else {parent="";}
	window.open('/ll/_news_edit?id='+id+parent,'newsCMS', 'left=120,top=50,width=750,height=690,toolbar=0,resizable=1,scrollbars=1');
}

function changeSelects(id,alias){
	if(alias!=undefined) {alias="&alias="+alias;}
	else {alias="";}
	window.open('/ll/_forms_selects?id='+id+alias,'CMS_selectes', 'left=120,top=50,width=540,height=270,toolbar=0,resizable=1,scrollbars=1');
}

function changeSelects_values2(id,alias){
	if(alias!=undefined) {alias="&alias="+alias;}
	else {alias="";}
	window.open('/ll/_forms_selects?value='+id+alias,'CMS_selectes', 'left=120,top=50,width=540,height=270,toolbar=0,resizable=1,scrollbars=1');
}

function changeProducts(id,parent){
	if(parent!=undefined) {parent="&parent="+parent;}
	else {parent="";}
	window.open('/ll/_product_edit?id='+id+parent,'productsCMS', 'left=120,top=50,width=790,height=690,toolbar=0,resizable=1,scrollbars=1');
}

function changeProductFields(id,parent){
	if(parent!=undefined) {parent="&parent="+parent;}
	else {parent="";}
	window.open('/ll/_productfields_edit?id='+id+parent,'productFieldsCMS', 'left=120,top=50,width=540,height=250,toolbar=0,resizable=1,scrollbars=1');
}








function izdrukat(id){
	window.open('/php.templates/headers/printpage.php?id='+id,'print', 'left=120,top=50,width=720,height=650,toolbar=0,resizable=1,scrollbars=1');
}



function changePersonal(id){
	window.open('/php.admin/personal.admin.php?id='+id,'personalCMS', 'left=120,top=50,width=750,height=690,toolbar=0,resizable=1,scrollbars=1');
}

function changeVacancies(id){
	window.open('/php.admin/vacancies.admin.php?id='+id,'vacanciesCMS', 'left=120,top=50,width=750,height=690,toolbar=0,resizable=1,scrollbars=1');
}




function global_print() {
	var win=null;
	win = window.open();
	self.focus();
	win.document.open();
	win.document.write('<'+'html'+'><'+'head'+'><link rel="stylesheet" type="text/css" href="/css/main.css" />');
	win.document.write('<'+'/'+'head'+'><'+'body style="padding:20px; font-size:12px; background:#FFF; " '+'>');
	var z = document.getElementById("print").innerHTML;
	z = z.replace(/ class="tbl"/g,' class="tbl" style="border:3px solid #AAA; font-weight:bold;"');
	win.document.write(z);
	win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
	win.document.close();
	win.print();
	win.close();
}


function saveList2PDF() {
	//document.getElementById("pdf_frame").src="/ll/gen.pdf.products.list";
	window.location="/ll/gen.pdf.product.list";
}
