function CMTOpenPopup(url,name,params) { temp = params.split('left='); if (temp[1]) { wleft = temp[1].substr(0,temp[1].indexOf(',')-1); temp[1] = temp[1].substr(wleft.length+1,temp[1].length); wleft = parseInt(wleft,10); temp1 = params.split('width='); wwidth = temp1[1].substr(0,temp1[1].indexOf(',')); if (!wwidth) { wwidth = temp1[1]; } wwidth = parseInt(wwidth,10)+5*2; swidth = screen.availWidth; wleft = parseInt((swidth-wwidth)*wleft/100,10); params = temp[0]+'left='+wleft+temp[1]; } temp = params.split('top='); if (temp[1]) { wtop = temp[1].substr(0,temp[1].indexOf(',')-1); temp[1] = temp[1].substr(wtop.length+1,temp[1].length); wtop = parseInt(wtop,10); temp1 = params.split('height='); wheight = temp1[1].substr(0,temp1[1].indexOf(',')); if (!wheight) { wheight = temp1[1]; } wheight = parseInt(wheight,10)+2*2+24; sheight = screen.availHeight; wtop = parseInt((sheight-wheight)*wtop/100,10); params = temp[0]+'top='+wtop+temp[1]; } wnd = open(url,name,params); } function CMTFormAction(frm,proto,url,wndname,wndparams,returnpage) { if (wndname) { wndname = 'formwnd'+parseInt(Math.random()*10000,10); CMTOpenPopup('',wndname,wndparams); frm.target = wndname; } if (proto=='post' || proto=='postmail' || proto=='postsearch' || proto=='postpage') { frm.method = 'POST'; } if (proto=='mail' || proto=='postmail') { frm.action = 'http://www.chaine-russia.com/cgi-bin/cmt.cgi'; frm.job.value = 'mail'; frm.to.value = url; frm.returnpage.value = returnpage; } else if (proto=='search' || proto=='postsearch') { frm.action = 'http://www.chaine-russia.com/cgi-bin/cmt.cgi'; frm.job.value = 'search'; frm.to.value = url; } else { frm.action = url; } frm.submit(); } function CMTChangeImages() { for (i=0; i<=arguments.length/2-1; i++) { if (document.images[arguments[i*2]]) { document.images[arguments[i*2]].src = arguments[i*2+1]; } } }