function stripLinks(objToStrip,strRef){//string wrapped as an object (object.strRef) to pass string by reference
	//opening and closing tags for links
	var arrTags = {//img can be wrapped in <a> so search <a> first then proper img tags then lazy img tags 
		'</a>':'<a','>':'<img','</iframe>':'<iframe'
	};
	var arrLnks = new Array();//buffer strings found
	for(var cTag in arrTags){
		oTag = arrTags[cTag];
		while (objToStrip[strRef].indexOf(oTag) !== -1){//whilst there are still occurences of opening tags	
			//substring each link
			var intFrst = objToStrip[strRef].indexOf(oTag);
			var intLst  = objToStrip[strRef].indexOf(cTag,intFrst) + cTag.length;
			var strLnk  = objToStrip[strRef].slice(intFrst,intLst);
			objToStrip[strRef] = objToStrip[strRef].replace(strLnk,'');//remove substring from original string
			//alert(strLnk);
			//buffer stripped links in array
			arrLnks.unshift(strLnk);
		}
	}		
	return strLnk = arrLnks.join('&nbsp');//format stripped links into a paragraph
}
		
function movLnks(strContainerTag){
	var strToStrip = document.getElementById(strContainerTag).innerHTML;
	if(strToStrip!='' && strToStrip!=null){
		var objLnk = new Object();//wrapper to pass string by reference
		objLnk.strng = strToStrip;
		var strStrpdLnks = stripLinks(objLnk,'strng');//strip links
		//alert(strStrpdLnks);//debug
		//rewrite innerhtml
		document.getElementById(strContainerTag).innerHTML = objLnk.strng;
		document.getElementById("footer_links").innerHTML = strStrpdLnks;
	}
	else{//alert('null tag!');
	}
}
