function setw(i, w)
{ document.getElementById(i).width = w; }

function resize()  {
if (document.body.clientWidth > 1150) 
{setw("lclm", "50%"); setw("cclm", "1150"); setw("rasp", "1150"); setw("rclm", "50%");
setw("lclm2", "50%"); setw("cclm2", "1150"); setw("rasp2", "1150"); setw("rclm2", "50%");
}else{ setw("lclm", "1"); setw("cclm", "100%"); setw("rasp", "760"); setw("rclm", "1"); 
setw("lclm2", "1"); setw("cclm2", "100%"); setw("rasp2", "760"); setw("rclm2", "1");}}

function fav(a, id)
{window.open('/action/fav'+a+'/?id='+id, 'fav'+a, 'width=200, height=45,menubar=no,location=no,scrollbars=no,resizable=no');}

function iview(i)
{window.open('/view/av.php?i='+i, 'ivie', 'menubar=no,location=no,scrollbars=yes,resizable=yes'); return false;}

function aw(a)
{window.open(a, 'aw', 'width=200, height=65,menubar=no,location=no,scrollbars=no,resizable=no');}

function aw_s(a, w, h)
{return window.open(a, 'aw', 'width='+w+', height='+h+',menubar=no,location=no,scrollbars=no,resizable=no');}

function aw_search(a, w, h)
{return window.open(a, 'aw', 'width='+w+', height='+h+',menubar=no,location=no,scrollbars=yes,resizable=no');}

function fwinset(f, t)
{w = window.open(t, 'formpwin', 'width=300, height=65,menubar=no,location=no,scrollbars=no,resizable=no'); f.target = 'formpwin'; }

function euncrypt(e, k)
{ var r=''; for(i=0; i<e.length; i++) r+=String.fromCharCode(e.charCodeAt(i)^k); return r; }

function etext(e, k)
{ document.write(euncrypt(e, k)); }

function elink(e, k)
{ parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+euncrypt(e, k); }

function check_j(f)
{var rj = /\.jpg|\.jpeg/i; if (f.search(rjgp) == -1) {
alert('Файл не является картинкой формата JPEG.');
return false;}return true;}

function check_jgp(f)
{var rjgp = /\.jpg|\.jpeg|\.gif|\.png/i;if (f.search(rjgp) == -1)  {
alert('Файл не является картинкой формата GIF, JPEG или PNG.');
return false;}return true;}

window.onResize = resize;

