window.onload = checkSearch;

function checkSearch(){
	if(window.location.search){
		var params = window.location.search.split('=');
		var folder = document.getElementById('innerFrame').getAttribute('folder');
		document.getElementById('innerFrame').src = 'popups/' + folder + '/' + params[1].toLowerCase() + '.html';
	}
}

function exportOut(){
	var response  = window.document.getElementsByTagName('body')[0];
	var cellContent = parent.document.getElementById('tdContent');

	cellContent.innerHTML = response.innerHTML + '<br><a href="' + parent.document.getElementById('innerFrame').getAttribute('folder') + '.html" class="linkBack">Back to ' + parent.document.getElementById('innerFrame').getAttribute('folder') + '</a>';
	
//	var elLink = document.createElement('A');
//	var elTextLink = document.createTextNode('Back to Client Success Stories');
//	elLink.appendChild(elTextLink);
//	cellContent.appendChild(elLink);
}


// Old Solution for popups=================================================
function clientPopup(topic, clientName){
	var address = 'popups/' + topic + '/_blank.html?item='+clientName;
	var win = window.open(address,'','width=640,height=480,scrollbars=yes');
	win.focus();
}


function loadStory(){
	var params = window.location.search.split('=');
	document.title = params[1] + ' - ' + document.title;
	document.getElementById('clientIframe').src = params[1].toLowerCase() + '.html';
	
}
