var sendCount=1; function picsAddFormItem(obj) { var obj1=new htmlTag1(obj,"div","formItem"); var l=new htmlTag1(obj1,"div","formLine"); var label=new htmlTag1(l,"label",""); var text=document.createTextNode('Picture:'); label.appendChild(text); var i=new htmlTag(l,"input","left"); i.obj.setAttribute("type","file"); i.obj.setAttribute("name","file"+(sendCount++)); i.append(); i=new htmlTag(l,"input","button"); i.obj.setAttribute ("type","button"); i.obj.value="cancel"; i.obj.onclick=function() { obj.removeChild(obj1); } i.append(); l=new htmlTag1(obj1,"div","formLine"); label=new htmlTag1(l,"label",""); text=document.createTextNode('Description:'); label.appendChild(text); i=new htmlTag(l,"input",""); i.obj.setAttribute("type","text"); i.obj.setAttribute("name","des[]"); i.append(); l=new htmlTag1(obj1,"div","formLine"); label=new htmlTag1(l,"label",""); text=document.createTextNode('Source:'); label.appendChild(text); i=new htmlTag(l,"input",""); i.obj.setAttribute("type","text"); i.obj.setAttribute("name","source[]"); i.append(); } function picsSend (form) { if (!form.elements[4].value) return; var body=document.getElementsByTagName("body")[0]; var inner=new innerSize(); var id=0; body.style.overflow="hidden"; var obj=new htmlTag(body,"div","userContainer"); obj.obj.style.width=body.offsetWidth+'px'; obj.obj.style.height=body.offsetHeight+'px'; obj=obj.append(); this.obj=obj; var obj1=new htmlTag(obj,"div","userInfoLayer"); //obj1.obj.style.top=(inner.scroll+20)+"px"; obj1.obj.style.height=(inner.height-40-20)+'px'; obj1=obj1.append(); var objPanel=new htmlTag1(obj1,"div","littlePanel"); objPanel.innerHTML="Sending Pictures"; var obj2=new htmlTag(obj1,"img","indicator"); obj2.att("src","images/indicator.gif"); obj2=obj2.append(); var layer=new htmlTag(obj1,"div","userProperties"); layer.obj.style.height=(inner.height-80)+'px'; layer=layer.append(); var layer1=new htmlTag(layer,"div","userProperties"); layer1.obj.style.height=(inner.height-80-50)+'px'; layer1=layer1.append(); var cont=new htmlTag(layer,"div",""); cont.obj.style.height='34px'; cont=cont.append(); layer=layer1; var ifr=document.getElementById("ext"); if (ifr.attachEvent) ifr.attachEvent("onload", cyk); else ifr.onload = cyk; function cyk() { advAJAX.post ({ url: base+'send.php', cmd: '_picsSendStatus', sendId: document.getElementById('sendId').value, onSuccess: function(res) { obj1.removeChild(obj2); var items=res.responseXML.getElementsByTagName('item'); for (var i=0;id.offsetWidth) { nw=d.offsetWidth; nh=Math.round(nw/(width/height)); } if (height>d.offsetHeight) { nh=d.offsetHeight; nw=Math.round((width/height)*nh); } im.style.marginLeft=(-Math.round(nw/2))+'px'; im.style.marginTop=(-Math.round(nh/2)+10)+'px'; im.width=nw; im.height=nh; im.className='resizedPicture'; im.onclick=function() { if (!im.full && (width>d.offsetWidth || height>d.offsetHeight)) { im.style.marginLeft='auto'; im.style.marginRight='auto'; var mt=Math.round((d.offsetHeight-height)/2); im.style.marginTop=((mt>=0)?mt:0)+'px'; im.style.position='relative'; im.style.left='0px'; im.style.top='0px'; im.width=width; im.height=height; im.full=true; } else { closeLayer(); } } d.appendChild(im); } im.src=pic.src; }