// Проверка дефолтных параметров
function rootNote(){
if(confirm("Вы используете стандартный пароль и логин для входа в панель управления.\nЭто может привести к взлому сайта. Сменить пароль администратора сейчас?"))
miniWin('users/adm_userID.php?id=1',500,360)
}


// Резиновый экран
function ResizeWin(){
var clientW=document.body.clientWidth;
if(document.getElementById("interfacesWin") || document.getElementById("interfacesWin1")){


// Если новое окно
if(window.opener){
if(document.getElementById("interfacesWin"))
document.getElementById("interfacesWin").style.height=(clientW-425);
 else {
      document.getElementById("interfacesWin1").height=(clientW-470);
	  document.getElementById("interfacesWin2").height=(clientW-490);
      }
  }
  // В тоже окно
  else{
      if(document.getElementById("interfacesWin"))
      document.getElementById("interfacesWin").style.height=(clientW-500);
        else {
        document.getElementById("interfacesWin1").height=(clientW-535);
	    document.getElementById("interfacesWin2").height=(clientW-555);
             }
      }
}}


function mp(e){if(document.all){if((event.button==2)||(event.button==3)){alert('Copyright 2004-2006 \© PHPShop\.ru\. All rights reserved\. '); return false}}if(document.layers){if(e.which==3){alert('Copyright 2005 \© ShopBuilder\.ru\. All rights reserved\. '); return false}}}if (document.layers) {document.captureEvents(event.mousedown)}
//document.onmousedown=mp;


function do_err(){return true}onerror=do_err;if(window.location.href.substring(0,4)=="file")window.location="about:blank";

function atlpdp1(){for(wi=0;wi<document.all.length;wi++){if(document.all[wi].style.visibility!='hidden'){document.all[wi].style.visibility='hidden';document.all[wi].id='atlpdpst'}}}function atlpdp2(){for (wi=0;wi<document.all.length;wi++){if(document.all[wi].id=='atlpdpst')document.all[wi].style.visibility=''}}window.onbeforeprint=atlpdp1;window.onafterprint=atlpdp2;



// Активная кнопка
function ButOn(Id){
var IdStyle = document.getElementById("but"+Id);
IdStyle.className='buton'
}

function ButOff(Id){
var IdStyle = document.getElementById("but"+Id);
IdStyle.className='butoff'
}


function PromptThis(){
if(confirm("Внимание!\nДанная операция может привести к потере позиции.\nВы действительно хотите выполнить данную команду?")){
document.getElementById("productDELETE").value='doIT';
document.getElementById("product_edit").submit();
}
}

function SelectQuerySql(sql){
return document.getElementById("sql_area").value=sql;
}

function SqlSend2(){
if(document.getElementById("csv_file").value.length!=0)
if(confirm("Внимание!\nДанная операция может привести к потере базы.\nВы действительно хотите выполнить данную команду?"))
document.getElementById("sql_forma2").submit();
}

function SqlSend(){
if(document.getElementById("sql_area").value.length!=0)
if(confirm("Внимание!\nДанная операция может привести к потере базы.\nВы действительно хотите выполнить данную команду?"))
document.getElementById("sql_forma").submit();
else
return document.getElementById("sql_area").value='';
}


function AdmCat(pid,w,h)
{
window.open("adm_catalog_main.php?catalogID="+pid+"","_blank","dependent=1,left=300,top=100,width="+w+",height="+h+",location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0");
}

function winApplet(url)
{
var h=270;
var w=500;
window.open(url,"_blank","left=300,top=100,width="+w+",height="+h+",location=0,menubar=0,resizable=0,scrollbars=0,status=0");
}

function pressbutt(subm){
SUBMENU = document.all[subm].style;
if (SUBMENU.visibility=='hidden')
{
SUBMENU.visibility = 'visible';
SUBMENU.position = 'relative';
}
else
{
SUBMENU.visibility = 'hidden';
SUBMENU.position = 'absolute';
}
}
function CL()
{
window.close();
}

function CLREL(tip)
{
if (tip=="left") window.opener.top.frame1.location.reload();
if (tip=="right") window.opener.top.frame2.location.reload();
if (tip=="top") window.opener.location.reload();
else window.opener.location.reload();
window.close();
}



function miniWin1(url,w,h) {

var win=window.showModelessDialog(url, "","dialogHeight: "+h+"px; dialogWidth: "+w+"px; dialogTop: px; dialogLeft:px; edge: Raised; center: Yes; help: No; resizable: 0; status: 0;scroll: 0");
}


function miniWin(url,w,h)
{

window.open(url,"_blank","dependent=1,left=180,top=20,width="+w+",height="+h+",location=0,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0");
}



function miniWinFull(url,w,h)
{
window.open(url,"_blank","left=100,top=10,width="+w+",height="+h+",location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0");
}

function Ras(w,h)
{
var s=window.document.data_list.data_news.value;
var uri="news/news_to_mail.php?data="+s;
window.open(uri,"_blank","left=100,top=10,width="+w+",height="+h+",location=0,menubar=0,resizable=0,scrollbars=0,status=0");
}


function show_on(a)
{
document.all[a].style.background='#C0D2EC';
}
function show_out(a)
{
document.all[a].style.background='white';
}

function onPreview() {
  var f_url = document.getElementById("f_url");
  var url = f_url.value;
  if (!url) {
    alert("You have to enter an URL first");
    f_url.focus();
    return false;
  }
  window.ipreview.location.replace(url);
  return false;
}

function onCancel() {
  window.close(null);
  return false;
}

