// This function makes sure that the content page is being shown inside the main frame
function framecheck() {
  var parentframe = '/index.htm';
  if (parent.location.href == self.location.href) {
    var current = window.self.location.pathname;
    var href = window.self.location.href;
    var pos = 0;
    var qs = "";
    if( ( pos = href.indexOf( "index.php?id=" ) ) != -1 )  // See if we have an id=
	{
		qs = href.substring( pos + 9, href.length );
	}
//  alert( "ds: " + qs );

//  alert( "going to: " + parentframe + '?' + current + qs );
    window.location.replace (parentframe + '?' + current + qs);
  }
}

