Hello, I need to resize an I-fame according to the height of an external page. I have found some google code that does what I need but it is way bloated. Anyone how to do what this code does but with less bloat? Thanks in Advance!
(
function(){
var e=null,a=window,l="sitesearch",r=a.googleSearchResizeIframe||a.googleSearchPath&&a.googleSearchPath=="/cse"&&typeof a.googleSearchResizeIframe=="undefined",p,n,i;function s(c,b,j,m){
var f={},g=c.split(j);for(var d=0;d<g.length;d++){
var h=g[d],o=h.indexOf(b);if(o>0){
var k=h.substring(0,o);k=m?k.toUpperCase():k.toLowerCase();var u=h.substring(o+1,h.length);f[k]=u}}return f}function v(){
var c=document.location.search;if(c.length<1)return"";c=c.substring(1,c.length);var b=s(c,"=","&",
false);if(a.googleSearchQueryString!="e"&&b[a.googleSearchQueryString]){
b.q=b[a.googleSearchQueryString];delete b[a.googleSearchQueryString]}if(b.cof){
var j=s(decodeURIComponent(b.cof),"-",";",true),m=j.FORID;if(m)p=parseInt(m,10)}
var f=document.getElementById(a.googleSearchFormName);
if(f){if(f.q&&b.q&&(!b.ie||b.ie.toLowerCase()=="utf-8"))f.q.value=decodeURIComponent(b.q.replace(/\+/g," "));
if(f[l])for(var g=0;g<f[l].length;g++)f[l][g].checked=b[l]==e&&f[l][g].value==""?true:f[l][g].value==b[l]?true:false}var d="";
for(var h in b)d+="&"+h+"="+b[h];return d.substring(1,d.length)}function q(c,b){return b?"&"+c+"="+encodeURIComponent(b):""}function t(c,b){return c?Math.max(c,b):b}function w(){
var c="http://";c+=a.googleSearchDomain?a.googleSearchDomain:"";c+=a.googleSearchPath?a.googleSearchPath:"";c+="?";
if(a.googleSearchQueryString)a.googleSearchQueryString=a.googleSearchQueryString.toLowerCase();c+=v();c+=q("ad","w"+n);c+=q("num",i);c+="&submit=search";if(r){
var b= a.location.href,j=b.indexOf("#");if(j!=-1)b=b.substring(0,j);c+=q("rurl",b)}return c}function x(){
//n=a.googleSearchNumAds;n||(n=9);
i=a.googleNumSearchResults;i=i?Math.min(i,20):10;
var c={};c[5]=795;c[10]=795;c[11]=500;
var b={};
b[5]=300+90*i;b[10]=300+50*Math.min(n,4)+90*i;b[11]=300+50*n+90*i;
//b[5] = 390+90*i;
var j=w();if(!a.googleSearchFrameborder)a.googleSearchFrameborder="0";
var m=document.getElementById(a.googleSearchIframeName);if(m&&c[p]){
var f=t(a.googleSearchFrameWidth,c[p]),g=t(a.googleSearchFrameHeight,b[p]),
d=document.createElement("iframe"),h={
name:"googleSearchFrame",src:j,frameBorder:a.googleSearchFrameborder,width:f,height:g,marginWidth:"0",marginHeight:"0",hspace:"0",vspace:"0",allowTransparency:"true",scrolling:"no"};for(var o in h)d.setAttribute(o,h[o]);m.appendChild(d);d.attachEvent?d.attachEvent("onload",
function(){
window.scrollTo(0,0)}):d.addEventListener("load",function(){
window.scrollTo(0,0)},false);r&&a.setInterval(
function(){
if(a.location.hash&&a.location.hash!="#"){
var k=a.location.hash.substring(1)+"px";
if(d.height!=k&&k!="0px")d.height=k}},10)}a.googleSearchIframeName=e;a.googleSearchFormName=e;a.googleSearchResizeIframe=e;a.googleSearchQueryString=e;a.googleSearchDomain=e;a.googleSearchPath=e;a.googleSearchFrameborder=e;a.googleSearchFrameWidth=e;a.googleSearchFrameHeight=e;a.googleNumSearchResults=e;a.googleAdtest=e}x()
})();