function buildPromoLinks() {
	var fileLink,iframeSrc;
	var queryStr = window.location.search.substring(1);
	if (queryStr != null && queryStr != "") { 
// if querystring exists only , append to all the hrefs
		if (document.getElementsByTagName('a')) {
			for (var i = 0; (fileLink = document.getElementsByTagName('a')[i]); i++) {
				if (fileLink.href.indexOf('?') != -1) { 
// if the link has already querystring then append value with &
					fileLink.href = fileLink.href + '&' + queryStr;
				} else { 
// if the link does not have querystring then add querystring
					if (fileLink.href != "" || fileLink.href != "#") {
if ( (fileLink.href.indexOf('javascript'.toLowerCase()) != 0) && (fileLink.href.indexOf('mailto'.toLowerCase()) != 0) ) {
							fileLink.href = fileLink.href + '?' + queryStr;
						}
					} // end file is not null
				}
			} // end for loop for a tags
		} // end if document a tags

		if (document.getElementsByTagName('iframe')) {
					for (var i = 0; (iframeSrc = document.getElementsByTagName('iframe')[i]); i++) {
						if (iframeSrc.src.indexOf('?') != -1) { 
// if the link has already querystring then append value with &
							iframeSrc.src = iframeSrc.src + '&' + queryStr;
						} else { 
// if the link does not have querystring then add querystring
if (iframeSrc.src != "" || iframeSrc.src != "#" || iframeSrc.src.indexOf('javascript'.toLowerCase()) > 0 || iframeSrc.src.indexOf('mailto'.toLowerCase()) > 0) {
								iframeSrc.src = iframeSrc.src + '?' + queryStr;
							}
						}
					} // end for loop for iframe tags
		} // end if document iframe tags

	} // end if queryStr
}
// call the javascript function after window loads
var previousOnload = window.onload;
window.onload = function() {
	if (previousOnload) {
		previousOnload();
	}
	buildPromoLinks();
}
