function ReFrame() 
{
    try
    {
        //if (top == self || (self.parent != null && self.parent.name.toLowerCase() != aName.toLowerCase()))
        if (top == self)
	    {   
		    var queryStr = document.location.search.substring(1);
		    var arrayQuery = queryStr.toLowerCase().split("&");
		    var newURL = "";
    		
		    for(var i = 0; i < arrayQuery.length; i++)
		    {
			    if(arrayQuery[i].indexOf("companyid" ) > -1) newURL = newURL + "&" + arrayQuery[i];
			    if(arrayQuery[i].indexOf("customerid") > -1) newURL = newURL + "&" + arrayQuery[i];
			    if(arrayQuery[i].indexOf("confirmid" ) > -1) newURL = newURL + "&" + arrayQuery[i];
		    }
    		
    		if(queryStr.length > 0)
    		    newURL = newURL + "&url=" + encodeURIComponent(self.location.pathname + "?" + queryStr);
    		else newURL = newURL + "&url=" + encodeURIComponent(self.location.pathname);
    		
		    if(newURL.length > 0) newURL = newURL.substring(1);
    		
		    top.location.replace(self.location.protocol + "//" + self.location.host + "/Default.aspx?" + newURL);
	    }
	}
	catch (e) 
	{
	    var loc = self.location.protocol + "//" + self.location.host + "/Default.aspx";
	    if (top.location.href.toLowerCase() != loc.toLowerCase()) 
	    {
	        top.location.replace(loc);
	    }
	}
}

ReFrame();
