//by InfoDome

$(document).ready(function() {
						   
	var theIframe=$('#box');
	
	//params based on this url model: .html?ifr=[local URL of page to be opened in iframe]
	var the_param = window.location.search.substring(1);
	var targetPage = /ifr\=/;
	var tpcParam = '';
	var targetDefault = '/main.html';
	
	//variables to be set by URL params
	var framedPageURL = null; //default to null if param is not present while keeping variable defined in the global space of this script's anon function
	
	//alert(the_param);
	if (the_param.match(targetPage) == null) { //check to see if there is anything present in url params after ?ifr=
		framedPageURL = targetDefault;
	} else {
		framedPageURL = 'http://sfpride.org/' + the_param.slice(4);
        //alert(framedPageURL);
	}
	

	if (framedPageURL != null) {
		$(theIframe).attr('src', framedPageURL);	
	} else {
		$(theIframe).attr('src', targetDefault);			
	}

	//alert(typeof framedPageURL);

});
