Try to add "_i" with attributeId e.g
contactid is your lookup attribute name, then you should pass like
document.getElementById("contactid_i").setAttribute("disableViewPicker", "1");
document.getElementById("contactid_i").setAttribute("defaulttype", "1");
document.getElementById("contactid_i").setAttribute("lookuptypenames","account:1:Account");
document.getElementById("contactid_i").setAttribute("lookuptypes", "1");
In crm 2011 attribute input id is same as attribute name, but in crm 2013 attribute input id is attribute name plus "_i"(perhaps "_i" denotes an input).
I try this "_i" in masking and multipicker lists working perfect for 2013. Hope it helps in your case.