function DAswapImgRestore() 
{
  var i,x,a=document.DA_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function DApreloadImages() 
{
  var d=document; if(d.images){ if(!d.DA_p) d.DA_p=new Array();
  var i,j=d.DA_p.length,a=DApreloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.DA_p[j]=new Image; d.DA_p[j++].src=a[i];}}
}

function DAfindObject(n, d) 
{
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=DAfindObject(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function DAswapImage() 
{
  var i,j=0,x,a=DAswapImage.arguments; document.DA_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=DAfindObject(a[i]))!=null){document.DA_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function banWin(w,h)
{
winBnr = window.open('','bnrWin','width='+w+',height='+h+',location=0,toolbar=0,menubar=0,scrollbars=0,status=0,resizable=0,left=0,top=0');
winBnr.focus();
}


function addSite()
{
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) 
{
var dasL = "http://www.hot.ee/dastudio/";
var dasN = "Digital Art Studio";
window.external.AddFavorite(dasL,dasN);
}
else 
{
alert("Press Ctrl+D to add this site to your Favorites!");
}
}


function maxWin()
{
window.moveTo(0,0);
if (document.all) 
{
window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) 
{
if (window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
{
window.outerHeight = screen.availHeight;
window.outerWidth = screen.availWidth;
}
}
}


function dasZoom()
{window.onError = null; var i=0; document.onkeydown = Zoom; function Zoom() {var ieKey = event.keyCode; if (ieKey == 88) {i++;document.body.style.zoom=1+i/10;} if (ieKey == 90) {i--;document.body.style.zoom=1+i/10;} if (ieKey == 32) {document.body.style.zoom=1;i=1;}}}


function okCount()
{
if ((window.location.href.substring(0,14)=="http://www.art") || (window.location.href.substring(0,10)=="http://art"))
{
document.write('<a href="http://counter.ok.ee/stats.php?ID=42749805704fa" class="hide" target="_blank"><img style="visibility:hidden;opacity:0;" src="http://counter.ok.ee/counter.php?ID=42749805704fa&stiil=23" border=0 nocache></a>');
}
else
{
document.write('&nbsp;');
}
}


function notNow()
{
alert("English version is currently unavailable.\nPlease check Russian version.");
document.location.href = "../rus/services.htm";
}


function daMirror()
{
if (window.location.href.substring(0,15)=="http://www.zone")
{
window.location = "http://artstudio.pri.ee/";
}
else
{
window.location = "http://www.zone.ee/dastudio/";
}
}


function zoomRu()
{
alert('Используйте клавиши:\n\nZ -- уменьшить изображение \nX -- увеличить изображение \nSPACE -- нормальный вид \n\nТолько для MS IExplorer.');
}

function zoomEn()
{
alert('You can use hotkeys:\n\nZ -- zoom out page view \nX -- zoom in page view \nSPACE bar -- normal view \n\nFor MS IExplorer only.');
}


function dasWin(w,h)
{
winNew = window.open('','scrWin','width='+w+',height='+h+',location=0,toolbar=0,menubar=0,scrollbars=1,status=0,resizable=1,left=0,top=0');
winNew.focus();
}


function mediaWin(w,h)
{
winMP = window.open('','mpWin','width='+w+',height='+h+',location=0,toolbar=0,menubar=0,scrollbars=0,status=0,resizable=0,left=0,top=0');
winMP.focus();
}


function daInfo()
{
xcom ="mail";
mbox = "info";
dom1 = "artstudio";
dom2 = ".pri";
dom3 = ".ee";
document.write('<a class="red" href="' + xcom + 'to:' + mbox + '@' + dom1 + dom2 + dom3 + '">' + mbox + '@' + dom1 + dom2 + dom3 + '</a>');
}


function dasMail()
{
xcom ="mail"
mbox = "info";
dom1 = "artstudio";
dom2 = ".pri";
dom3 = ".ee";
document.write('<a title="e-mail" href="' + xcom + 'to:' + mbox + '@' + dom1 + dom2 + dom3 + '">' + '<img src="../pix/ic3.gif" width="14" height="14" border="0"></a>');
}


function downWin(w,h)
{
dlWin = window.open('','fileWin','width='+w+',height='+h+',location=0,toolbar=0,menubar=0,scrollbars=0,status=0,resizable=0,left=0,top=0');
dlWin.focus();
}


function daGetFile(fileID)
{
if (fileID!=1&&fileID!=2)
{
alert('Error: there is no such file or directory!');
}
else
{
if (fileID==1)
{
alert('Your password for installation:\nwww.artstudio.pri.ee\n\nВаш пароль для установки:\nwww.artstudio.pri.ee');
window.location.href = "http://artstudio.pri.ee/up/comsp.zip"
}
else
{
if (fileID==2)
{
alert('Your password for installation:\nwww.artstudio.pri.ee\n\nВаш пароль для установки:\nwww.artstudio.pri.ee');
window.location.href = "http://artstudio.pri.ee/up/mirsp.zip"
}
}
}
}


function getKey()
{
var askKey = confirm ('This is NOT free software. You can purchase the license on the official website of software author.\nIf you really like this product - buy it!\n\n\n\nYou also can search on internet for some temporary license "for educational purposes only".\n\nWarning!\nDigital Art Studio provides links to other web resources (websites, files etc.), but takes no responsibility for possible illegal or harmful content of these web resources.\n\nPressing button "OK" you confirm that you have read and understood this disclaimer\nand accept all responsibility for your further actions.\n\nDo you wish to continue?\n\n\n- - - - - - - -\n\n\nЭта программа НЕ бесплатная. Вы можете приобрести лицензию на официальном сайте автора этого продукта. Если вам нравится этот продукт - купите его!\n\n\n\nВы можете также искать в интернете временную лицензию "для образовательных целей".\n\nВнимание!\nDigital Art Studio предоставляет ссылки на другие web ресурсы (сайты, файлы и т.д.),\nно не несет никакой ответственности за возможное нелегальное или вредоносное содержимое этих ресурсов.\n\nНажимая кнопку "OK" вы подтверждаете, что прочитали и поняли это предупреждение и принимаете на себя всю ответственность за ваши дальнейшие действия.\n\nВы желаете продолжить?')
if (askKey)
{
exWin = window.open('','exWin','width=600,height=400,location=1,toolbar=1,menubar=1,scrollbars=1,status=1,resizable=1,left=0,top=0');
exWin.focus();
exWin.location.href = "http://astalavista.box.sk/cgi-bin/robot?srch=total+commander&submit=+search+";
}
else
{
void(0);
}
}


function checkRef()
{
var validreferrals=new Array()
validreferrals[0]="artstudio.pri.ee"
validreferrals[1]="zone.ee/dastudio"
var passed=0
for (r=0;r<validreferrals.length;r++)
{
if (document.referrer.indexOf(validreferrals[r])!=-1)
{
passed=1
break
}
}
if (passed==0)
{
document.location.href="http://artstudio.pri.ee/"
}
}


function clearField(field)
{
if (field.defaultValue==field.value)
field.value = ""
} 


function inMenu()
{
document.write(unescape("%3Ctable%20width%3D%22100%25%22%20border%3D%220%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%20bgcolor%3D%22%23FFFFFF%22%3E%3Ctr%3E%3Ctd%20width%3D%22100%25%22%20height%3D%222%22%20bgcolor%3D%22%23333333%22%3E%3Cimg%20src%3D%22../pix/sp.gif%22%20width%3D%221%22%20height%3D%221%22%3E%3C/td%3E%3C/tr%3E%20%3Ctr%3E%20%3Ctd%20width%3D%22100%25%22%20height%3D%2291%22%20align%3D%22left%22%20valign%3D%22middle%22%20bgcolor%3D%22%23FFFFFF%22%3E%3Ctable%20width%3D%22768%22%20border%3D%220%22%20cellspacing%3D%220%22%20cellpadding%3D%220%22%3E%20%3Ctr%3E%20%3Ctd%20width%3D%2288%22%20height%3D%2291%22%3E%26nbsp%3B%3C/td%3E%20%3Ctd%20width%3D%2292%22%20align%3D%22center%22%20valign%3D%22middle%22%20bgcolor%3D%22%23F7EEEE%22%3E%3Cimg%20src%3D%22../pix/dalogo.gif%22%20alt%3D%22DAS%20logo%22%20width%3D%2260%22%20height%3D%2276%22%20border%3D%220%22%3E%3C/td%3E%20%3Ctd%20width%3D%22568%22%20align%3D%22center%22%20valign%3D%22middle%22%3E%3Ctable%20width%3D%22512%22%20border%3D%220%22%20cellspacing%3D%220%22%20cellpadding%3D%220%22%3E%20%3Ctr%20align%3D%22center%22%3E%20%3Ctd%20width%3D%22128%22%20height%3D%2291%22%20valign%3D%22middle%22%3E%3Ca%20href%3D%22services.htm%22%20onMouseOut%3D%22DAswapImgRestore%28%29%3B%20tm1.style.backgroundColor%3D%27%23EEEEEE%27%22%20onMouseOver%3D%22DAswapImage%28%27mo1%27%2C%27%27%2C%27../pix/mo1.gif%27%2C1%29%3B%20tm1.style.backgroundColor%3D%27%23DFDFDF%27%22%3E%3Cimg%20src%3D%22../pix/m1.gif%22%20alt%3D%22services%22%20name%3D%22mo1%22%20width%3D%2296%22%20height%3D%2272%22%20border%3D%220%22%3E%3C/a%3E%3C/td%3E%20%3Ctd%20width%3D%22128%22%20valign%3D%22middle%22%3E%3Ca%20href%3D%22projects.htm%22%20onMouseOut%3D%22DAswapImgRestore%28%29%3B%20tm2.style.backgroundColor%3D%27%23EEEEEE%27%22%20onMouseOver%3D%22DAswapImage%28%27mo2%27%2C%27%27%2C%27../pix/mo2.gif%27%2C1%29%3B%20tm2.style.backgroundColor%3D%27%23DFDFDF%27%22%3E%3Cimg%20src%3D%22../pix/m2.gif%22%20alt%3D%22solutions%22%20name%3D%22mo2%22%20width%3D%2296%22%20height%3D%2272%22%20border%3D%220%22%3E%3C/a%3E%3C/td%3E%20%3Ctd%20width%3D%22128%22%20valign%3D%22middle%22%3E%3Ca%20href%3D%22prices.htm%22%20onMouseOut%3D%22DAswapImgRestore%28%29%3B%20tm3.style.backgroundColor%3D%27%23EEEEEE%27%22%20onMouseOver%3D%22DAswapImage%28%27mo3%27%2C%27%27%2C%27../pix/mo3.gif%27%2C1%29%3B%20tm3.style.backgroundColor%3D%27%23DFDFDF%27%22%3E%3Cimg%20src%3D%22../pix/m3.gif%22%20alt%3D%22pricelist%22%20name%3D%22mo3%22%20width%3D%2296%22%20height%3D%2272%22%20border%3D%220%22%3E%3C/a%3E%3C/td%3E%20%3Ctd%20width%3D%22128%22%20valign%3D%22middle%22%3E%3Ca%20href%3D%22contact.htm%22%20onMouseOut%3D%22DAswapImgRestore%28%29%3B%20tm4.style.backgroundColor%3D%27%23EEEEEE%27%22%20onMouseOver%3D%22DAswapImage%28%27mo4%27%2C%27%27%2C%27../pix/mo4.gif%27%2C1%29%3B%20tm4.style.backgroundColor%3D%27%23DFDFDF%27%22%3E%3Cimg%20src%3D%22../pix/m4.gif%22%20alt%3D%22contact%22%20name%3D%22mo4%22%20width%3D%2296%22%20height%3D%2272%22%20border%3D%220%22%3E%3C/a%3E%3C/td%3E%20%3C/tr%3E%20%3C/table%3E%3C/td%3E%20%3Ctd%20width%3D%2220%22%3E%26nbsp%3B%3C/td%3E%20%3C/tr%3E%20%3C/table%3E%3C/td%3E%20%3C/tr%3E%20%3Ctr%3E%20%3Ctd%20width%3D%22100%25%22%20height%3D%222%22%20bgcolor%3D%22%23333333%22%3E%3Cimg%20src%3D%22../pix/sp.gif%22%20width%3D%221%22%20height%3D%221%22%3E%3C/td%3E%20%3C/tr%3E%20%3C/table%3E"));
}


function noPix()
{
document.write(unescape("%3Cscript%20language%3DJavaScript%3Edocument.onselectstart%3Dnew%20Function%28%22return%20false%22%29%3B%20document.ondragstart%3Dnew%20Function%28%22return%20false%22%29%3B%3C/script%3E%0D%0A%3Cscript%20language%3D%22JavaScript%22%3Efunction%20do_err%28%29%7Breturn%20true%7Donerror%3Ddo_err%3B%20function%20do_dd%28%29%7Breturn%20false%7Ddocument.ondragstart%3Ddo_dd%3B%3C/script%3E%0D%0A%3Cscript%20language%3DJavaScript%3Efunction%20atlpdp1%28%29%7Bfor%28wi%3D0%3Bwi%3Cdocument.all.length%3Bwi++%29%7Bif%28document.all%5Bwi%5D.style.visibility%21%3D%27hidden%27%29%7Bdocument.all%5Bwi%5D.style.visibility%3D%27hidden%27%3Bdocument.all%5Bwi%5D.id%3D%27atlpdpst%27%7D%7D%7Dfunction%20atlpdp2%28%29%7Bfor%20%28wi%3D0%3Bwi%3Cdocument.all.length%3Bwi++%29%7Bif%28document.all%5Bwi%5D.id%3D%3D%27atlpdpst%27%29document.all%5Bwi%5D.style.visibility%3D%27%27%7D%7Dwindow.onbeforeprint%3Datlpdp1%3Bwindow.onafterprint%3Datlpdp2%3B%3C/script%3E%0D%0A%3Cscript%20language%3D%22JavaScript%22%3Eif%28frames%29%7Bif%28top.frames.length%3E0%29top.location.href%3Dself.location%3B%7D%3C/script%3E%0D%0A%3Cscript%3Efunction%20noClick%28%29%20%7Bevent.cancelBubble%20%3D%20true%3B%20event.returnValue%20%3D%20false%3B%7D%20document.oncontextmenu%20%3D%20noClick%3B%3C/script%3E%0D%0A%3Cscript%20language%3DJavaScript%3Efunction%20clickNo%28e%29%20%7Bif%20%28document.all%29%20%7Bif%20%28event.button%20%3D%3D%202%29%20%7Breturn%20false%3B%7D%7D%20if%20%28document.layers%29%20%7Bif%20%28e.which%20%3D%3D%203%29%20%7Breturn%20false%3B%7D%7D%7D%20if%20%28document.layers%29%20%7Bdocument.captureEvents%28event.mousedown%29%3B%7D%20document.onmousedown%3DclickNo%3B%3C/script%3E%20"));
}
