function getE(obj){
	return document.getElementById(obj);	
}

function returnSize (type, param) {
	if(type==1){ width=150; height=300; }
	if(type==2){ width=200; height=300; }
	if(type==3){ width=570; height=720; }
	if(type==4){ width=204; height=225; }
	if(type==5){ width=210; height=176; }
	if(type==6){ width=310; height=226; }
	if(type==7){ width=150; height=150; }
	if(type==8){ width=170; height=200; }
	if(type==9){ width=220; height=300; }
	if(type==10){ width=150; height=180; }
	if(type==11){ width=150; height=272; }
	if(type==12){ width=150; height=195; }
	if(type==13){ width=150; height=262; }
	if(type==14){ width=220; height=300; }
	if(type==15){ width=160; height=221; }
	if(type==16){ width=160; height=311; }
	if(type==17){ width=570; height=640; }
	if(type==18){ width=150; height=195; }
	if(type==19){ width=600; height=170; }
	if(type==20){ width=545; height=720; }
	if(type==21){ width=400; height=200; }
	if(type==22){ width=150; height=220; }
	if(type==23){ width=400; height=160; }

	if(type==24){ width=155; height=167; }
	if(type==25){ width=276; height=167; }
	if(type==26){ width=471; height=167; }

	if (param=="width") { return (width); }
	if (param=="height") { return (height); }
}

function showWidget(url,type,color,data){
	el=getE("widgetCode");
	if(type==1){ width=150; height=300; }
	if(type==2){ width=200; height=300; }
	if(type==3){ width=570; height=720; }
	if(type==4){ width=204; height=225; }
	if(type==5){ width=210; height=176; }
	if(type==6){ width=310; height=226; }
	if(type==7){ width=150; height=150; }
	if(type==8){ width=170; height=200; }
	if(type==9){ width=220; height=300; }
	if(type==10){ width=150; height=180; }
	if(type==11){ width=150; height=272; }
	if(type==12){ width=150; height=195; }
	if(type==13){ width=150; height=262; }
	if(type==14){ width=220; height=300; }
	if(type==15){ width=160; height=221; }
	if(type==16){ width=160; height=311; }
	if(type==17){ width=570; height=640; }
	if(type==18){ width=150; height=195; }
	if(type==19){ width=600; height=170; }
	if(type==20){ width=545; height=720; }
	if(type==21){ width=400; height=200; }
	if(type==22){ width=150; height=220; }
	if(type==23){ width=400; height=160; }

	if(type==24){ width=155; height=167; }
	if(type==25){ width=276; height=167; }
	if(type==26){ width=471; height=167; }

	
	if (data!="") { adding="&data="+data; } else { adding=""; }
	
	str=document.body.innerHTML;	
	return '<iframe id="smahuWidget" frameborder="0" scrolling="no" style="width:'+width+'px;height:'+height+'px;" src="http://widget.smahu.com/'+url+'?c='+color+'&width='+width+'&height='+height+'&type='+type+(str.indexOf("www.smahu.com")==-1?'&add=1':'&add=0')+adding+'"></iframe>';
}