// INCLUDED and used by getitnext_helper.html
// Tell the parent iframe what height the iframe needs to be
function parentIframeResize(){
	var height = getParam('height');
	var jump = getParam('j');
	// This works as our parent's parent is on our domain
	if (top.location != location) parent.parent.resizeIframe(height, jump);
}

// Helper function, parse param from request string
function getParam( name ){
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	var results = regex.exec( window.location.href );
	if( results == null ) return "";
	else return results[1];
}

// INCLUDED and used by partner site
// Resize iframe to full height
function resizeIframe(height, jump){
	// "+60" is a general rule of thumb to allow for differences in
	// IE & and FF height reporting, can be adjusted as required
	var content = document.getElementById("getitnext_content");
	if ( content == undefined ) return;
	content.height = parseInt(height);
	content.width = '100%';
	if ( jump == undefined || jump == "" || (jump && jump!=0) ) content.scrollIntoView(true);
}
