function fnImage(img) { 
	var noimg = document.getElementById(img)? document.getElementById(img) : document.all[img];
	noimg.innerHTML='<div class="imgnf"></div>';
} 
function getImgSize(id,x,y){
	var pic = document.getElementById(id)? document.getElementById(id) : document.all[id];
	var ih=0;
	var iw=0;
	for (i=1;i<50;i++){
		ih= pic.naturalHeight? pic.naturalHeight : pic.height;
		if(ih>0){
			break;
		}
	}
	for (i=1;i<50;i++){
		iw= pic.naturalWidth? pic.naturalWidth : pic.width;
		if(iw>0){
			break;
		}
	}
	iw1=x
	ih1=Math.round((x/iw)*ih)
	if(ih1>y) {
		ih1=y
		iw1=Math.round((y/ih)*iw)
	}
	pic.height=ih1;
	pic.width=iw1;
	//alert("Actual Size =H"+ih+" =W"+iw+" ID= "+id);	
}
function fnsearch(){
	if (document.all.searchtxt.value==''){
		alert("Enter Keyword");
		document.all.searchtxt.focus();
		return false;
	} else {	
		fninquerysearch(document.all.searchtxt.value,document.all.searchtyp.value)
	}
}
function fninquerysearch(stxt,typ){
	var sr=stxt;
    	var regEx = new RegExp ('&', 'gi') ;
    	sr = sr.replace(regEx, ' ')
    	var regEx1 = new RegExp ('   ', 'gi') ;
    	sr = sr.replace(regEx1, ' ')
	var regEx2 = new RegExp (' ', 'gi') ;
    	sr = sr.replace(regEx2, '_');
    	if(typ==1){
		document.location.href = '/business/search.asp?searchtxt='+sr; 
	} else if(typ==2){
		document.location.href = '/products/search.asp?searchtxt='+sr; 
	} else if(typ==3){
		document.location.href = '/offers/search.asp?searchtxt='+sr; 
	} else if(typ==4){
		document.location.href = '/link/search.asp?searchtxt='+sr; 
	}
}
function fnLink(lnk){
	document.getElementById("ChkVal").src =lnk;
}

